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.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.
Layout
struct aiNode {
struct aiString
mName()
;struct aiMatrix4x4
mTransformation()
;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 class
AINode.Buffer
An array ofAINode
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
MCHILDREN
MMESHES
MMETADATA
MNAME
MNUMCHILDREN
MNUMMESHES
MPARENT
MTRANSFORMATIONThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AINode(java.nio.ByteBuffer container)
Creates aAINode
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AINode
calloc()
Returns a newAINode
instance allocated withmemCalloc
.static AINode.Buffer
calloc(int capacity)
Returns a newAINode.Buffer
instance allocated withmemCalloc
.static AINode.Buffer
calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAINode.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static AINode
calloc(org.lwjgl.system.MemoryStack stack)
Returns a newAINode
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static AINode
callocStack()
Deprecated.static AINode.Buffer
callocStack(int capacity)
Deprecated.static AINode.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static AINode
callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.static AINode
create()
Returns a newAINode
instance allocated withBufferUtils
.static AINode.Buffer
create(int capacity)
Returns a newAINode.Buffer
instance allocated withBufferUtils
.static AINode
create(long address)
Returns a newAINode
instance for the specified memory address.static AINode.Buffer
create(long address, int capacity)
Create aAINode.Buffer
instance at the specified memory.static AINode
createSafe(long address)
static AINode.Buffer
createSafe(long address, int capacity)
static AINode
malloc()
Returns a newAINode
instance allocated withmemAlloc
.static AINode.Buffer
malloc(int capacity)
Returns a newAINode.Buffer
instance allocated withmemAlloc
.static AINode.Buffer
malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAINode.Buffer
instance allocated on the specifiedMemoryStack
.static AINode
malloc(org.lwjgl.system.MemoryStack stack)
Returns a newAINode
instance allocated on the specifiedMemoryStack
.static AINode
mallocStack()
Deprecated.static AINode.Buffer
mallocStack(int capacity)
Deprecated.static AINode.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.static AINode
mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.org.lwjgl.PointerBuffer
mChildren()
The child nodes of this node.AINode
mChildren(org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBuffer
to themChildren()
field.java.nio.IntBuffer
mMeshes()
The meshes of this node.AINode
mMeshes(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to themMeshes()
field.AIMetaData
mMetadata()
Metadata associated with this node orNULL
if there is no metadata.AINode
mMetadata(AIMetaData value)
Sets the address of the specifiedAIMetaData
to themMetadata()
field.AIString
mName()
The name of the node.AINode
mName(java.util.function.Consumer<AIString> consumer)
Passes themName()
field to the specifiedConsumer
.AINode
mName(AIString value)
int
mNumChildren()
The number of child nodes of this node.int
mNumMeshes()
The number of meshes of this node.AINode
mParent()
Parent node.AINode
mParent(AINode value)
AIMatrix4x4
mTransformation()
The transformation relative to the node's parent.AINode
mTransformation(java.util.function.Consumer<AIMatrix4x4> consumer)
Passes themTransformation()
field to the specifiedConsumer
.AINode
mTransformation(AIMatrix4x4 value)
Copies the specifiedAIMatrix4x4
to themTransformation()
field.static org.lwjgl.PointerBuffer
nmChildren(long struct)
Unsafe version ofmChildren
.static void
nmChildren(long struct, org.lwjgl.PointerBuffer value)
Unsafe version ofmChildren
.static java.nio.IntBuffer
nmMeshes(long struct)
Unsafe version ofmMeshes
.static void
nmMeshes(long struct, java.nio.IntBuffer value)
Unsafe version ofmMeshes
.static AIMetaData
nmMetadata(long struct)
Unsafe version ofmMetadata()
.static void
nmMetadata(long struct, AIMetaData value)
Unsafe version ofmMetadata
.static AIString
nmName(long struct)
Unsafe version ofmName()
.static void
nmName(long struct, AIString value)
Unsafe version ofmName
.static int
nmNumChildren(long struct)
Unsafe version ofmNumChildren()
.static void
nmNumChildren(long struct, int value)
Sets the specified value to themNumChildren
field of the specifiedstruct
.static int
nmNumMeshes(long struct)
Unsafe version ofmNumMeshes()
.static void
nmNumMeshes(long struct, int value)
Sets the specified value to themNumMeshes
field of the specifiedstruct
.static AINode
nmParent(long struct)
Unsafe version ofmParent()
.static void
nmParent(long struct, AINode value)
Unsafe version ofmParent
.static AIMatrix4x4
nmTransformation(long struct)
Unsafe version ofmTransformation()
.static void
nmTransformation(long struct, AIMatrix4x4 value)
Unsafe version ofmTransformation
.AINode
set(AINode src)
Copies the specified struct data to this struct.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.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.
-
-
-
Constructor Detail
-
AINode
public AINode(java.nio.ByteBuffer container)
Creates aAINode
instance at the current position of the specifiedByteBuffer
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 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
AIBone
andAIMesh
::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.NULL
if 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.NULL
ifmNumChildren
is 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 orNULL
if 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 specifiedAIMatrix4x4
to 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 specifiedPointerBuffer
to themChildren()
field.
-
mMeshes
public AINode mMeshes(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to themMeshes()
field.
-
mMetadata
public AINode mMetadata(@Nullable AIMetaData value)
Sets the address of the specifiedAIMetaData
to 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 newAINode
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static AINode calloc()
Returns a newAINode
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static AINode create()
Returns a newAINode
instance allocated withBufferUtils
.
-
create
public static AINode create(long address)
Returns a newAINode
instance for the specified memory address.
-
createSafe
@Nullable public static AINode createSafe(long address)
-
malloc
public static AINode.Buffer malloc(int capacity)
Returns a newAINode.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static AINode.Buffer calloc(int capacity)
Returns a newAINode.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static AINode.Buffer create(int capacity)
Returns a newAINode.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static AINode.Buffer create(long address, int capacity)
Create aAINode.Buffer
instance 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 newAINode
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static AINode calloc(org.lwjgl.system.MemoryStack stack)
Returns a newAINode
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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 themNumChildren
field 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 themNumMeshes
field 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
-
-