Class AINodeAnim

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AINodeAnim extends Struct<AINodeAnim> implements NativeResource
Describes the animation of a single node. The name specifies the bone/node which is affected by this animation channel. The keyframes are given in three separate series of values, one each for position, rotation and scaling. The transformation matrix computed from these values replaces the node's original transformation matrix at a specific time.

This means all keys are absolute and not relative to the bone default pose. The order in which the transformations are applied is - as usual - scaling, rotation, translation.

Note:

All keys are returned in their correct, chronological order. Duplicate keys don't pass the validation step. Most likely there will be no negative time values, but they are not forbidden also ( so implementations need to cope with them! )

Layout


 struct aiNodeAnim {
     struct aiString mNodeName();
     unsigned int mNumPositionKeys();
     struct aiVectorKey * mPositionKeys();
     unsigned int mNumRotationKeys();
     struct aiQuatKey * mRotationKeys();
     unsigned int mNumScalingKeys();
     struct aiVectorKey * mScalingKeys();
     aiAnimBehaviour mPreState();
     aiAnimBehaviour mPostState();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MNODENAME
      The struct member offsets.
    • MNUMPOSITIONKEYS

      public static final int MNUMPOSITIONKEYS
      The struct member offsets.
    • MPOSITIONKEYS

      public static final int MPOSITIONKEYS
      The struct member offsets.
    • MNUMROTATIONKEYS

      public static final int MNUMROTATIONKEYS
      The struct member offsets.
    • MROTATIONKEYS

      public static final int MROTATIONKEYS
      The struct member offsets.
    • MNUMSCALINGKEYS

      public static final int MNUMSCALINGKEYS
      The struct member offsets.
    • MSCALINGKEYS

      public static final int MSCALINGKEYS
      The struct member offsets.
    • MPRESTATE

      public static final int MPRESTATE
      The struct member offsets.
    • MPOSTSTATE

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

    • AINodeAnim

      public AINodeAnim(ByteBuffer container)
      Creates a AINodeAnim 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<AINodeAnim>
    • mNodeName

      public AIString mNodeName()
      The name of the node affected by this animation. The node must exist and it must be unique.
    • mNumPositionKeys

      public int mNumPositionKeys()
      The number of position keys
    • mPositionKeys

      @Nullable public AIVectorKey.Buffer mPositionKeys()
      The position keys of this animation channel. Positions are specified as 3D vector. The array is mNumPositionKeys in size. If there are position keys, there will also be at least one scaling and one rotation key.
    • mNumRotationKeys

      public int mNumRotationKeys()
      The number of rotation keys
    • mRotationKeys

      @Nullable public AIQuatKey.Buffer mRotationKeys()
      The rotation keys of this animation channel. Rotations are given as quaternions, which are 4D vectors. The array is mNumRotationKeys in size. If there are rotation keys, there will also be at least one scaling and one position key.
    • mNumScalingKeys

      public int mNumScalingKeys()
      The number of scaling keys
    • mScalingKeys

      @Nullable public AIVectorKey.Buffer mScalingKeys()
      The scaling keys of this animation channel. Scalings are specified as 3D vector. The array is mNumScalingKeys in size. If there are scaling keys, there will also be at least one position and one rotation key.
    • mPreState

      public int mPreState()
      Defines how the animation behaves before the first key is encountered. The default value is aiAnimBehaviour_DEFAULT (the original transformation matrix of the affected node is used). One of:
      AnimBehaviour_DEFAULTAnimBehaviour_CONSTANTAnimBehaviour_LINEAR
      AnimBehaviour_REPEAT
    • mPostState

      public int mPostState()
      Defines how the animation behaves after the last key was processed. The default value is aiAnimBehaviour_DEFAULT (the original transformation matrix of the affected node is taken). One of:
      AnimBehaviour_DEFAULTAnimBehaviour_CONSTANTAnimBehaviour_LINEAR
      AnimBehaviour_REPEAT
    • mNodeName

      public AINodeAnim mNodeName(AIString value)
      Copies the specified AIString to the mNodeName() field.
    • mNodeName

      public AINodeAnim mNodeName(Consumer<AIString> consumer)
      Passes the mNodeName() field to the specified Consumer.
    • mPositionKeys

      public AINodeAnim mPositionKeys(@Nullable AIVectorKey.Buffer value)
      Sets the address of the specified AIVectorKey.Buffer to the mPositionKeys() field.
    • mRotationKeys

      public AINodeAnim mRotationKeys(@Nullable AIQuatKey.Buffer value)
      Sets the address of the specified AIQuatKey.Buffer to the mRotationKeys() field.
    • mScalingKeys

      public AINodeAnim mScalingKeys(@Nullable AIVectorKey.Buffer value)
      Sets the address of the specified AIVectorKey.Buffer to the mScalingKeys() field.
    • mPreState

      public AINodeAnim mPreState(int value)
      Sets the specified value to the mPreState() field.
    • mPostState

      public AINodeAnim mPostState(int value)
      Sets the specified value to the mPostState() field.
    • set

      public AINodeAnim set(AIString mNodeName, @Nullable AIVectorKey.Buffer mPositionKeys, @Nullable AIQuatKey.Buffer mRotationKeys, @Nullable AIVectorKey.Buffer mScalingKeys, int mPreState, int mPostState)
      Initializes this struct with the specified values.
    • set

      public AINodeAnim set(AINodeAnim src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static AINodeAnim malloc()
      Returns a new AINodeAnim instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static AINodeAnim calloc()
      Returns a new AINodeAnim instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static AINodeAnim create()
      Returns a new AINodeAnim instance allocated with BufferUtils.
    • create

      public static AINodeAnim create(long address)
      Returns a new AINodeAnim instance for the specified memory address.
    • createSafe

      @Nullable public static AINodeAnim createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static AINodeAnim.Buffer malloc(int capacity)
      Returns a new AINodeAnim.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static AINodeAnim.Buffer calloc(int capacity)
      Returns a new AINodeAnim.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static AINodeAnim.Buffer create(int capacity)
      Returns a new AINodeAnim.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static AINodeAnim.Buffer create(long address, int capacity)
      Create a AINodeAnim.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

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

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

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

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

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

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

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

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

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

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

      public static AINodeAnim calloc(MemoryStack stack)
      Returns a new AINodeAnim instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

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

      public static AINodeAnim.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new AINodeAnim.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
    • nmNodeName

      public static AIString nmNodeName(long struct)
      Unsafe version of mNodeName().
    • nmNumPositionKeys

      public static int nmNumPositionKeys(long struct)
      Unsafe version of mNumPositionKeys().
    • nmPositionKeys

      @Nullable public static AIVectorKey.Buffer nmPositionKeys(long struct)
      Unsafe version of mPositionKeys().
    • nmNumRotationKeys

      public static int nmNumRotationKeys(long struct)
      Unsafe version of mNumRotationKeys().
    • nmRotationKeys

      @Nullable public static AIQuatKey.Buffer nmRotationKeys(long struct)
      Unsafe version of mRotationKeys().
    • nmNumScalingKeys

      public static int nmNumScalingKeys(long struct)
      Unsafe version of mNumScalingKeys().
    • nmScalingKeys

      @Nullable public static AIVectorKey.Buffer nmScalingKeys(long struct)
      Unsafe version of mScalingKeys().
    • nmPreState

      public static int nmPreState(long struct)
      Unsafe version of mPreState().
    • nmPostState

      public static int nmPostState(long struct)
      Unsafe version of mPostState().
    • nmNodeName

      public static void nmNodeName(long struct, AIString value)
      Unsafe version of mNodeName.
    • nmNumPositionKeys

      public static void nmNumPositionKeys(long struct, int value)
      Sets the specified value to the mNumPositionKeys field of the specified struct.
    • nmPositionKeys

      public static void nmPositionKeys(long struct, @Nullable AIVectorKey.Buffer value)
      Unsafe version of mPositionKeys.
    • nmNumRotationKeys

      public static void nmNumRotationKeys(long struct, int value)
      Sets the specified value to the mNumRotationKeys field of the specified struct.
    • nmRotationKeys

      public static void nmRotationKeys(long struct, @Nullable AIQuatKey.Buffer value)
      Unsafe version of mRotationKeys.
    • nmNumScalingKeys

      public static void nmNumScalingKeys(long struct, int value)
      Sets the specified value to the mNumScalingKeys field of the specified struct.
    • nmScalingKeys

      public static void nmScalingKeys(long struct, @Nullable AIVectorKey.Buffer value)
      Unsafe version of mScalingKeys.
    • nmPreState

      public static void nmPreState(long struct, int value)
      Unsafe version of mPreState.
    • nmPostState

      public static void nmPostState(long struct, int value)
      Unsafe version of mPostState.
    • validate

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