Package org.lwjgl.assimp
Class AIBone
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.assimp.AIBone
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class AIBone extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceA single bone of a mesh.A bone has a name by which it can be found in the frame hierarchy and by which it can be addressed by animations. In addition it has a number of influences on vertices, and a matrix relating the mesh position to the position of the bone at the time of binding.
Member documentation
mName– the name of the bone.mNumWeights– the number of vertices affected by this bone. The maximum value for this member isAssimp.AI_MAX_BONE_WEIGHTS.mWeights– the influence weights of this bone, by vertex indexmOffsetMatrix– matrix that transforms from bone space to mesh space in bind pose.This matrix describes the position of the mesh in the local space of this bone when the skeleton was bound. Thus it can be used directly to determine a desired vertex position, given the world-space transform of the bone when animated, and the position of the vertex in mesh space.
It is sometimes called an inverse-bind matrix, or inverse bind pose matrix.
Layout
struct aiBone {struct aiStringmName; unsigned int mNumWeights;struct aiVertexWeight* mWeights;struct aiMatrix4x4mOffsetMatrix; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAIBone.BufferAn array ofAIBonestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intMNAME
MNUMWEIGHTS
MOFFSETMATRIX
MWEIGHTSThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AIBone(java.nio.ByteBuffer container)Creates aAIBoneinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AIBonecalloc()Returns a newAIBoneinstance allocated withmemCalloc.static AIBone.Buffercalloc(int capacity)Returns a newAIBone.Bufferinstance allocated withmemCalloc.static AIBonecallocStack()Returns a newAIBoneinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AIBone.BuffercallocStack(int capacity)Returns a newAIBone.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AIBone.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAIBone.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AIBonecallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAIBoneinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AIBonecreate()Returns a newAIBoneinstance allocated withBufferUtils.static AIBone.Buffercreate(int capacity)Returns a newAIBone.Bufferinstance allocated withBufferUtils.static AIBonecreate(long address)Returns a newAIBoneinstance for the specified memory address.static AIBone.Buffercreate(long address, int capacity)Create aAIBone.Bufferinstance at the specified memory.static AIBonecreateSafe(long address)static AIBone.BuffercreateSafe(long address, int capacity)static AIBonemalloc()Returns a newAIBoneinstance allocated withmemAlloc.static AIBone.Buffermalloc(int capacity)Returns a newAIBone.Bufferinstance allocated withmemAlloc.static AIBonemallocStack()Returns a newAIBoneinstance allocated on the thread-localMemoryStack.static AIBone.BuffermallocStack(int capacity)Returns a newAIBone.Bufferinstance allocated on the thread-localMemoryStack.static AIBone.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAIBone.Bufferinstance allocated on the specifiedMemoryStack.static AIBonemallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAIBoneinstance allocated on the specifiedMemoryStack.AIStringmName()Returns aAIStringview of themNamefield.AIBonemName(java.util.function.Consumer<AIString> consumer)Passes themNamefield to the specifiedConsumer.AIBonemName(AIString value)Copies the specifiedAIStringto themNamefield.intmNumWeights()Returns the value of themNumWeightsfield.AIMatrix4x4mOffsetMatrix()Returns aAIMatrix4x4view of themOffsetMatrixfield.AIBonemOffsetMatrix(java.util.function.Consumer<AIMatrix4x4> consumer)Passes themOffsetMatrixfield to the specifiedConsumer.AIBonemOffsetMatrix(AIMatrix4x4 value)Copies the specifiedAIMatrix4x4to themOffsetMatrixfield.AIVertexWeight.BuffermWeights()Returns aAIVertexWeight.Bufferview of the struct array pointed to by themWeightsfield.AIBonemWeights(AIVertexWeight.Buffer value)Sets the address of the specifiedAIVertexWeight.Bufferto themWeightsfield.static AIStringnmName(long struct)Unsafe version ofmName().static voidnmName(long struct, AIString value)Unsafe version ofmName.static intnmNumWeights(long struct)Unsafe version ofmNumWeights().static voidnmNumWeights(long struct, int value)Sets the specified value to themNumWeightsfield of the specifiedstruct.static AIMatrix4x4nmOffsetMatrix(long struct)Unsafe version ofmOffsetMatrix().static voidnmOffsetMatrix(long struct, AIMatrix4x4 value)Unsafe version ofmOffsetMatrix.static AIVertexWeight.BuffernmWeights(long struct)Unsafe version ofmWeights().static voidnmWeights(long struct, AIVertexWeight.Buffer value)Unsafe version ofmWeights.AIBoneset(AIBone src)Copies the specified struct data to this struct.AIBoneset(AIString mName, AIVertexWeight.Buffer mWeights, AIMatrix4x4 mOffsetMatrix)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
-
AIBone
public AIBone(java.nio.ByteBuffer container)
Creates aAIBoneinstance 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
-
mNumWeights
public int mNumWeights()
Returns the value of themNumWeightsfield.
-
mWeights
public AIVertexWeight.Buffer mWeights()
Returns aAIVertexWeight.Bufferview of the struct array pointed to by themWeightsfield.
-
mOffsetMatrix
public AIMatrix4x4 mOffsetMatrix()
Returns aAIMatrix4x4view of themOffsetMatrixfield.
-
mName
public AIBone mName(java.util.function.Consumer<AIString> consumer)
Passes themNamefield to the specifiedConsumer.
-
mWeights
public AIBone mWeights(AIVertexWeight.Buffer value)
Sets the address of the specifiedAIVertexWeight.Bufferto themWeightsfield.
-
mOffsetMatrix
public AIBone mOffsetMatrix(AIMatrix4x4 value)
Copies the specifiedAIMatrix4x4to themOffsetMatrixfield.
-
mOffsetMatrix
public AIBone mOffsetMatrix(java.util.function.Consumer<AIMatrix4x4> consumer)
Passes themOffsetMatrixfield to the specifiedConsumer.
-
set
public AIBone set(AIString mName, AIVertexWeight.Buffer mWeights, AIMatrix4x4 mOffsetMatrix)
Initializes this struct with the specified values.
-
set
public AIBone set(AIBone src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static AIBone malloc()
Returns a newAIBoneinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static AIBone calloc()
Returns a newAIBoneinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static AIBone create()
Returns a newAIBoneinstance allocated withBufferUtils.
-
create
public static AIBone create(long address)
Returns a newAIBoneinstance for the specified memory address.
-
createSafe
@Nullable public static AIBone createSafe(long address)
-
malloc
public static AIBone.Buffer malloc(int capacity)
Returns a newAIBone.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static AIBone.Buffer calloc(int capacity)
Returns a newAIBone.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static AIBone.Buffer create(int capacity)
Returns a newAIBone.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static AIBone.Buffer create(long address, int capacity)
Create aAIBone.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static AIBone.Buffer createSafe(long address, int capacity)
-
mallocStack
public static AIBone mallocStack()
Returns a newAIBoneinstance allocated on the thread-localMemoryStack.
-
callocStack
public static AIBone callocStack()
Returns a newAIBoneinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static AIBone mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAIBoneinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static AIBone callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAIBoneinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static AIBone.Buffer mallocStack(int capacity)
Returns a newAIBone.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static AIBone.Buffer callocStack(int capacity)
Returns a newAIBone.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static AIBone.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAIBone.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static AIBone.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAIBone.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmNumWeights
public static int nmNumWeights(long struct)
Unsafe version ofmNumWeights().
-
nmWeights
public static AIVertexWeight.Buffer nmWeights(long struct)
Unsafe version ofmWeights().
-
nmOffsetMatrix
public static AIMatrix4x4 nmOffsetMatrix(long struct)
Unsafe version ofmOffsetMatrix().
-
nmNumWeights
public static void nmNumWeights(long struct, int value)Sets the specified value to themNumWeightsfield of the specifiedstruct.
-
nmWeights
public static void nmWeights(long struct, AIVertexWeight.Buffer value)Unsafe version ofmWeights.
-
nmOffsetMatrix
public static void nmOffsetMatrix(long struct, AIMatrix4x4 value)Unsafe version ofmOffsetMatrix.
-
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
-
-