Class AINode

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AINode extends Struct<AINode> implements NativeResource

 struct aiNode {
     {@link AIString struct aiString} mName;
     {@link AIMatrix4x4 struct aiMatrix4x4} mTransformation;
     {@link AINode struct aiNode} * mParent;
     unsigned int mNumChildren;
     {@link AINode struct aiNode} ** mChildren;
     unsigned int mNumMeshes;
     unsigned int * mMeshes;
     {@link AIMetaData struct aiMetadata} * mMetadata;
 }
  • Field Details

    • SIZEOF

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

      public static final int ALIGNOF
      The struct alignment in bytes.
    • MNAME

      public static final int MNAME
      The struct member offsets.
    • MTRANSFORMATION

      public static final int MTRANSFORMATION
      The struct member offsets.
    • MPARENT

      public static final int MPARENT
      The struct member offsets.
    • MNUMCHILDREN

      public static final int MNUMCHILDREN
      The struct member offsets.
    • MCHILDREN

      public static final int MCHILDREN
      The struct member offsets.
    • MNUMMESHES

      public static final int MNUMMESHES
      The struct member offsets.
    • MMESHES

      public static final int MMESHES
      The struct member offsets.
    • MMETADATA

      public static final int MMETADATA
      The struct member offsets.
  • Constructor Details

    • AINode

      public AINode(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<AINode>
    • mName

      public AIString mName()
      Returns:
      a AIString view of the mName field.
    • mTransformation

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

      public @Nullable 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

      public @Nullable 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

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

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

      public AINode mName(AIString value)
      Copies the specified AIString to the mName field.
    • mName

      public AINode mName(Consumer<AIString> consumer)
      Passes the mName field to the specified Consumer.
    • mTransformation

      public AINode mTransformation(AIMatrix4x4 value)
      Copies the specified AIMatrix4x4 to the mTransformation field.
    • mTransformation

      public AINode mTransformation(Consumer<AIMatrix4x4> consumer)
      Passes the mTransformation field to the specified Consumer.
    • mParent

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

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

      public AINode mMeshes(@Nullable 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, @Nullable AINode mParent, @Nullable PointerBuffer mChildren, @Nullable IntBuffer mMeshes, @Nullable 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

      public static @Nullable 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

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

      @Deprecated public static AINode mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AINode callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AINode mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AINode callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AINode.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AINode.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static AINode.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AINode.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static AINode malloc(MemoryStack stack)
      Returns a new AINode instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static AINode calloc(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
    • malloc

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

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

      public static AIString nmName(long struct)
      Unsafe version of mName().
    • nmTransformation

      public static AIMatrix4x4 nmTransformation(long struct)
      Unsafe version of mTransformation().
    • nmParent

      public static @Nullable AINode nmParent(long struct)
      Unsafe version of mParent().
    • nmNumChildren

      public static int nmNumChildren(long struct)
      Unsafe version of mNumChildren().
    • nmChildren

      public static @Nullable PointerBuffer nmChildren(long struct)
      Unsafe version of mChildren.
    • nmNumMeshes

      public static int nmNumMeshes(long struct)
      Unsafe version of mNumMeshes().
    • nmMeshes

      public static @Nullable IntBuffer nmMeshes(long struct)
      Unsafe version of mMeshes.
    • nmMetadata

      public static @Nullable AIMetaData nmMetadata(long struct)
      Unsafe version of mMetadata().
    • nmName

      public static void nmName(long struct, AIString value)
      Unsafe version of mName.
    • nmTransformation

      public static void nmTransformation(long struct, AIMatrix4x4 value)
      Unsafe version of mTransformation.
    • nmParent

      public static void nmParent(long struct, @Nullable AINode value)
      Unsafe version of mParent.
    • nmNumChildren

      public static void nmNumChildren(long struct, int value)
      Sets the specified value to the mNumChildren field of the specified struct.
    • nmChildren

      public static void nmChildren(long struct, @Nullable PointerBuffer value)
      Unsafe version of mChildren.
    • nmNumMeshes

      public static void nmNumMeshes(long struct, int value)
      Sets the specified value to the mNumMeshes field of the specified struct.
    • nmMeshes

      public static void nmMeshes(long struct, @Nullable IntBuffer value)
      Unsafe version of mMeshes.
    • nmMetadata

      public static void nmMetadata(long struct, @Nullable AIMetaData value)
      Unsafe version of mMetadata.
    • validate

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