Class AINode

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


    public class AINode
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    A node in the imported hierarchy.

    Each node has name, a parent node (except for the root node), a transformation relative to its parent and possibly several child nodes. Simple file formats don't support hierarchical structures - for these formats the imported scene does consist of only a single root node without children.

    Member documentation

    • mName – The name of the node.
    • mTransformation – The transformation relative to the node's parent.
    • mParent – Parent node. NULL if this node is the root node.
    • mNumChildren – The number of child nodes of this node.
    • mChildren – The child nodes of this node. NULL if mNumChildren is 0.
    • mNumMeshes – The number of meshes of this node.
    • mMeshes – The meshes of this node. Each entry is an index into the mesh list of the aiScene.
    • mMetadata – Metadata associated with this node or NULL if there is no metadata.

    Layout

     struct aiNode {
         struct aiString mName;
         struct aiMatrix4x4 mTransformation;
         struct aiNode * mParent;
         unsigned int mNumChildren;
         struct aiNode ** mChildren;
         unsigned int mNumMeshes;
         unsigned int * mMeshes;
         struct aiMetadata * mMetadata;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  AINode.Buffer
      An array of AINode structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor and Description
      AINode(java.nio.ByteBuffer container)
      Creates a AINode instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • AINode

        public AINode(java.nio.ByteBuffer container)
        Creates a AINode instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • mTransformation

        public AIMatrix4x4 mTransformation()
        Returns a AIMatrix4x4 view of the mTransformation field.
      • mParent

        @Nullable
        public AINode mParent()
        Returns a AINode view of the struct pointed to by the mParent field.
      • mNumChildren

        public int mNumChildren()
        Returns the value of the mNumChildren field.
      • mChildren

        @Nullable
        public org.lwjgl.PointerBuffer mChildren()
        Returns a PointerBuffer view of the data pointed to by the mChildren field.
      • mNumMeshes

        public int mNumMeshes()
        Returns the value of the mNumMeshes field.
      • mMeshes

        @Nullable
        public java.nio.IntBuffer mMeshes()
        Returns a IntBuffer view of the data pointed to by the mMeshes field.
      • mMetadata

        @Nullable
        public AIMetaData mMetadata()
        Returns a AIMetaData view of the struct pointed to by the mMetadata field.
      • mParent

        public AINode mParent(@Nullable
                              AINode value)
        Sets the address of the specified AINode to the mParent field.
      • mChildren

        public AINode mChildren(@Nullable
                                org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mChildren field.
      • mMeshes

        public AINode mMeshes(@Nullable
                              java.nio.IntBuffer value)
        Sets the address of the specified IntBuffer to the mMeshes field.
      • mMetadata

        public AINode mMetadata(@Nullable
                                AIMetaData value)
        Sets the address of the specified AIMetaData to the mMetadata field.
      • set

        public AINode set(AIString mName,
                          AIMatrix4x4 mTransformation,
                          AINode mParent,
                          org.lwjgl.PointerBuffer mChildren,
                          java.nio.IntBuffer mMeshes,
                          AIMetaData mMetadata)
        Initializes this struct with the specified values.
      • set

        public AINode set(AINode src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static AINode malloc()
        Returns a new AINode instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static AINode calloc()
        Returns a new AINode instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static AINode create()
        Returns a new AINode instance allocated with BufferUtils.
      • create

        public static AINode create(long address)
        Returns a new AINode instance for the specified memory address.
      • createSafe

        @Nullable
        public static AINode createSafe(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static AINode.Buffer malloc(int capacity)
        Returns a new AINode.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static AINode.Buffer calloc(int capacity)
        Returns a new AINode.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static AINode.Buffer create(int capacity)
        Returns a new AINode.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static AINode.Buffer create(long address,
                                           int capacity)
        Create a AINode.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static AINode.Buffer createSafe(long address,
                                               int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static AINode mallocStack()
        Returns a new AINode instance allocated on the thread-local MemoryStack.
      • callocStack

        public static AINode callocStack()
        Returns a new AINode instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static AINode mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AINode instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static AINode callocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AINode instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static AINode.Buffer mallocStack(int capacity)
        Returns a new AINode.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static AINode.Buffer callocStack(int capacity)
        Returns a new AINode.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static AINode.Buffer mallocStack(int capacity,
                                                org.lwjgl.system.MemoryStack stack)
        Returns a new AINode.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static AINode.Buffer callocStack(int capacity,
                                                org.lwjgl.system.MemoryStack stack)
        Returns a new AINode.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • validate

        public static void validate(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate(long array,
                                    int count)
        Calls AINode.validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array