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.
Layout
struct aiNode {struct aiStringmName();struct aiMatrix4x4mTransformation();struct aiNode*mParent(); unsigned intmNumChildren();struct aiNode**mChildren(); unsigned intmNumMeshes(); 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 Deprecated 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 AINode.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAINode.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AINodecalloc(org.lwjgl.system.MemoryStack stack)Returns a newAINodeinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AINodecallocStack()Deprecated.static AINode.BuffercallocStack(int capacity)Deprecated.static AINode.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static AINodecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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 AINode.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAINode.Bufferinstance allocated on the specifiedMemoryStack.static AINodemalloc(org.lwjgl.system.MemoryStack stack)Returns a newAINodeinstance allocated on the specifiedMemoryStack.static AINodemallocStack()Deprecated.static AINode.BuffermallocStack(int capacity)Deprecated.static AINode.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static AINodemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.org.lwjgl.PointerBuffermChildren()The child nodes of this node.AINodemChildren(org.lwjgl.PointerBuffer value)Sets the address of the specifiedPointerBufferto themChildren()field.java.nio.IntBuffermMeshes()The meshes of this node.AINodemMeshes(java.nio.IntBuffer value)Sets the address of the specifiedIntBufferto themMeshes()field.AIMetaDatamMetadata()Metadata associated with this node orNULLif there is no metadata.AINodemMetadata(AIMetaData value)Sets the address of the specifiedAIMetaDatato themMetadata()field.AIStringmName()The name of the node.AINodemName(java.util.function.Consumer<AIString> consumer)Passes themName()field to the specifiedConsumer.AINodemName(AIString value)intmNumChildren()The number of child nodes of this node.intmNumMeshes()The number of meshes of this node.AINodemParent()Parent node.AINodemParent(AINode value)AIMatrix4x4mTransformation()The transformation relative to the node's parent.AINodemTransformation(java.util.function.Consumer<AIMatrix4x4> consumer)Passes themTransformation()field to the specifiedConsumer.AINodemTransformation(AIMatrix4x4 value)Copies the specifiedAIMatrix4x4to themTransformation()field.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.
-
-
-
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
-
mName
public AIString 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
public AIMatrix4x4 mTransformation()
The transformation relative to the node's parent.
-
mParent
@Nullable public AINode mParent()
Parent node.NULLif this node is the root node.
-
mNumChildren
public int mNumChildren()
The number of child nodes of this node.
-
mChildren
@Nullable public org.lwjgl.PointerBuffer mChildren()
The child nodes of this node.NULLifmNumChildrenis 0.
-
mNumMeshes
public int mNumMeshes()
The number of meshes of this node.
-
mMeshes
@Nullable public java.nio.IntBuffer mMeshes()
The meshes of this node. Each entry is an index into the mesh list of theAIScene.
-
mMetadata
@Nullable public AIMetaData 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.
-
mName
public AINode mName(java.util.function.Consumer<AIString> consumer)
Passes themName()field to the specifiedConsumer.
-
mTransformation
public AINode mTransformation(AIMatrix4x4 value)
Copies the specifiedAIMatrix4x4to themTransformation()field.
-
mTransformation
public AINode mTransformation(java.util.function.Consumer<AIMatrix4x4> consumer)
Passes themTransformation()field to the specifiedConsumer.
-
mChildren
public AINode mChildren(@Nullable org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBufferto themChildren()field.
-
mMeshes
public AINode mMeshes(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBufferto themMeshes()field.
-
mMetadata
public AINode mMetadata(@Nullable AIMetaData value)
Sets the address of the specifiedAIMetaDatato themMetadata()field.
-
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
@Deprecated public static AINode mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static AINode callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static AINode mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static AINode callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static AINode.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static AINode.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static AINode.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static AINode.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static AINode malloc(org.lwjgl.system.MemoryStack stack)
Returns a newAINodeinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static AINode calloc(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
-
malloc
public static AINode.Buffer malloc(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
-
calloc
public static AINode.Buffer calloc(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
-
-