Class AINode
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.assimp.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.NativeResourceA 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.The name might be empty (length of zero) but all nodes which need to be referenced by either bones or animations are named. Multiple nodes may have the same name, except for nodes which are referenced by bones (see
AIBoneandAIMesh::mBones). Their names must be unique.Cameras and lights reference a specific node by name - if there are multiple nodes with this name, they are assigned to each of them.
There are no limitations with regard to the characters contained in the name string as it is usually taken directly from the source file.
Implementations should be able to handle tokens such as whitespace, tabs, line feeds, quotation marks, ampersands etc.
Sometimes assimp introduces new nodes not present in the source file into the hierarchy (usually out of necessity because sometimes the source hierarchy format is simply not compatible). Their names are surrounded by
<>e.g.<DummyRootNode>.mTransformation– The transformation relative to the node's parent.mParent– Parent node.NULLif this node is the root node.mNumChildren– The number of child nodes of this node.mChildren– The child nodes of this node.NULLifmNumChildrenis 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 theAIScene.mMetadata– Metadata associated with this node orNULLif there is no metadata.Whether any metadata is generated depends on the source file format. See the importer notes page for more information on every source file format. Importers that don't document any metadata don't write any.
Layout
struct aiNode {struct aiStringmName;struct aiMatrix4x4mTransformation;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 Description static classAINode.BufferAn array ofAINodestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intMCHILDREN
MMESHES
MMETADATA
MNAME
MNUMCHILDREN
MNUMMESHES
MPARENT
MTRANSFORMATIONThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AINode(java.nio.ByteBuffer container)Creates aAINodeinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AINodecalloc()Returns a newAINodeinstance allocated withmemCalloc.static AINode.Buffercalloc(int capacity)Returns a newAINode.Bufferinstance allocated withmemCalloc.static AINodecallocStack()Returns a newAINodeinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AINode.BuffercallocStack(int capacity)Returns a newAINode.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AINode.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAINode.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AINodecallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAINodeinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AINodecreate()Returns a newAINodeinstance allocated withBufferUtils.static AINode.Buffercreate(int capacity)Returns a newAINode.Bufferinstance allocated withBufferUtils.static AINodecreate(long address)Returns a newAINodeinstance for the specified memory address.static AINode.Buffercreate(long address, int capacity)Create aAINode.Bufferinstance at the specified memory.static AINodecreateSafe(long address)static AINode.BuffercreateSafe(long address, int capacity)static AINodemalloc()Returns a newAINodeinstance allocated withmemAlloc.static AINode.Buffermalloc(int capacity)Returns a newAINode.Bufferinstance allocated withmemAlloc.static AINodemallocStack()Returns a newAINodeinstance allocated on the thread-localMemoryStack.static AINode.BuffermallocStack(int capacity)Returns a newAINode.Bufferinstance allocated on the thread-localMemoryStack.static AINode.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAINode.Bufferinstance allocated on the specifiedMemoryStack.static AINodemallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAINodeinstance allocated on the specifiedMemoryStack.org.lwjgl.PointerBuffermChildren()Returns aPointerBufferview of the data pointed to by themChildrenfield.AINodemChildren(org.lwjgl.PointerBuffer value)Sets the address of the specifiedPointerBufferto themChildrenfield.java.nio.IntBuffermMeshes()Returns aIntBufferview of the data pointed to by themMeshesfield.AINodemMeshes(java.nio.IntBuffer value)Sets the address of the specifiedIntBufferto themMeshesfield.AIMetaDatamMetadata()Returns aAIMetaDataview of the struct pointed to by themMetadatafield.AINodemMetadata(AIMetaData value)Sets the address of the specifiedAIMetaDatato themMetadatafield.AIStringmName()Returns aAIStringview of themNamefield.AINodemName(java.util.function.Consumer<AIString> consumer)Passes themNamefield to the specifiedConsumer.AINodemName(AIString value)Copies the specifiedAIStringto themNamefield.intmNumChildren()Returns the value of themNumChildrenfield.intmNumMeshes()Returns the value of themNumMeshesfield.AINodemParent()Returns aAINodeview of the struct pointed to by themParentfield.AINodemParent(AINode value)Sets the address of the specifiedAINodeto themParentfield.AIMatrix4x4mTransformation()Returns aAIMatrix4x4view of themTransformationfield.AINodemTransformation(java.util.function.Consumer<AIMatrix4x4> consumer)Passes themTransformationfield to the specifiedConsumer.AINodemTransformation(AIMatrix4x4 value)Copies the specifiedAIMatrix4x4to themTransformationfield.static org.lwjgl.PointerBuffernmChildren(long struct)Unsafe version ofmChildren.static voidnmChildren(long struct, org.lwjgl.PointerBuffer value)Unsafe version ofmChildren.static java.nio.IntBuffernmMeshes(long struct)Unsafe version ofmMeshes.static voidnmMeshes(long struct, java.nio.IntBuffer value)Unsafe version ofmMeshes.static AIMetaDatanmMetadata(long struct)Unsafe version ofmMetadata().static voidnmMetadata(long struct, AIMetaData value)Unsafe version ofmMetadata.static AIStringnmName(long struct)Unsafe version ofmName().static voidnmName(long struct, AIString value)Unsafe version ofmName.static intnmNumChildren(long struct)Unsafe version ofmNumChildren().static voidnmNumChildren(long struct, int value)Sets the specified value to themNumChildrenfield of the specifiedstruct.static intnmNumMeshes(long struct)Unsafe version ofmNumMeshes().static voidnmNumMeshes(long struct, int value)Sets the specified value to themNumMeshesfield of the specifiedstruct.static AINodenmParent(long struct)Unsafe version ofmParent().static voidnmParent(long struct, AINode value)Unsafe version ofmParent.static AIMatrix4x4nmTransformation(long struct)Unsafe version ofmTransformation().static voidnmTransformation(long struct, AIMatrix4x4 value)Unsafe version ofmTransformation.AINodeset(AINode src)Copies the specified struct data to this struct.AINodeset(AIString mName, AIMatrix4x4 mTransformation, AINode mParent, org.lwjgl.PointerBuffer mChildren, java.nio.IntBuffer mMeshes, AIMetaData mMetadata)Initializes this struct with the specified values.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
AINode
public AINode(java.nio.ByteBuffer container)
Creates aAINodeinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
mTransformation
public AIMatrix4x4 mTransformation()
Returns aAIMatrix4x4view of themTransformationfield.
-
mParent
@Nullable public AINode mParent()
Returns aAINodeview of the struct pointed to by themParentfield.
-
mNumChildren
public int mNumChildren()
Returns the value of themNumChildrenfield.
-
mChildren
@Nullable public org.lwjgl.PointerBuffer mChildren()
Returns aPointerBufferview of the data pointed to by themChildrenfield.
-
mNumMeshes
public int mNumMeshes()
Returns the value of themNumMeshesfield.
-
mMeshes
@Nullable public java.nio.IntBuffer mMeshes()
Returns aIntBufferview of the data pointed to by themMeshesfield.
-
mMetadata
@Nullable public AIMetaData mMetadata()
Returns aAIMetaDataview of the struct pointed to by themMetadatafield.
-
mName
public AINode mName(java.util.function.Consumer<AIString> consumer)
Passes themNamefield to the specifiedConsumer.
-
mTransformation
public AINode mTransformation(AIMatrix4x4 value)
Copies the specifiedAIMatrix4x4to themTransformationfield.
-
mTransformation
public AINode mTransformation(java.util.function.Consumer<AIMatrix4x4> consumer)
Passes themTransformationfield to the specifiedConsumer.
-
mParent
public AINode mParent(@Nullable AINode value)
Sets the address of the specifiedAINodeto themParentfield.
-
mChildren
public AINode mChildren(@Nullable org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBufferto themChildrenfield.
-
mMeshes
public AINode mMeshes(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBufferto themMeshesfield.
-
mMetadata
public AINode mMetadata(@Nullable AIMetaData value)
Sets the address of the specifiedAIMetaDatato themMetadatafield.
-
set
public AINode set(AIString mName, AIMatrix4x4 mTransformation, @Nullable AINode mParent, @Nullable org.lwjgl.PointerBuffer mChildren, @Nullable java.nio.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 newAINodeinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static AINode calloc()
Returns a newAINodeinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static AINode create()
Returns a newAINodeinstance allocated withBufferUtils.
-
create
public static AINode create(long address)
Returns a newAINodeinstance for the specified memory address.
-
createSafe
@Nullable public static AINode createSafe(long address)
-
malloc
public static AINode.Buffer malloc(int capacity)
Returns a newAINode.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static AINode.Buffer calloc(int capacity)
Returns a newAINode.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static AINode.Buffer create(int capacity)
Returns a newAINode.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static AINode.Buffer create(long address, int capacity)
Create aAINode.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static AINode.Buffer createSafe(long address, int capacity)
-
mallocStack
public static AINode mallocStack()
Returns a newAINodeinstance allocated on the thread-localMemoryStack.
-
callocStack
public static AINode callocStack()
Returns a newAINodeinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static AINode mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAINodeinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static AINode callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAINodeinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static AINode.Buffer mallocStack(int capacity)
Returns a newAINode.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static AINode.Buffer callocStack(int capacity)
Returns a newAINode.Bufferinstance allocated on the thread-localMemoryStackand 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 newAINode.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static AINode.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAINode.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmTransformation
public static AIMatrix4x4 nmTransformation(long struct)
Unsafe version ofmTransformation().
-
nmNumChildren
public static int nmNumChildren(long struct)
Unsafe version ofmNumChildren().
-
nmChildren
@Nullable public static org.lwjgl.PointerBuffer nmChildren(long struct)
Unsafe version ofmChildren.
-
nmNumMeshes
public static int nmNumMeshes(long struct)
Unsafe version ofmNumMeshes().
-
nmMeshes
@Nullable public static java.nio.IntBuffer nmMeshes(long struct)
Unsafe version ofmMeshes.
-
nmMetadata
@Nullable public static AIMetaData nmMetadata(long struct)
Unsafe version ofmMetadata().
-
nmTransformation
public static void nmTransformation(long struct, AIMatrix4x4 value)Unsafe version ofmTransformation.
-
nmParent
public static void nmParent(long struct, @Nullable AINode value)Unsafe version ofmParent.
-
nmNumChildren
public static void nmNumChildren(long struct, int value)Sets the specified value to themNumChildrenfield of the specifiedstruct.
-
nmChildren
public static void nmChildren(long struct, @Nullable org.lwjgl.PointerBuffer value)Unsafe version ofmChildren.
-
nmNumMeshes
public static void nmNumMeshes(long struct, int value)Sets the specified value to themNumMeshesfield of the specifiedstruct.
-
nmMeshes
public static void nmMeshes(long struct, @Nullable java.nio.IntBuffer value)Unsafe version ofmMeshes.
-
nmMetadata
public static void nmMetadata(long struct, @Nullable AIMetaData value)Unsafe version ofmMetadata.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
validate
public static void validate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-