Class AINodeAnim

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class AINodeAnim
    extends Struct
    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! )

    Member documentation

    • mNodeName – The name of the node affected by this animation. The node must exist and it must be unique.
    • mNumPositionKeys – The number of position keys
    • 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 – The number of rotation keys
    • 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 – The number of scaling keys
    • 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 – 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).
    • 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).

    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 Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MNODENAME, MNUMPOSITIONKEYS, MPOSITIONKEYS, MNUMROTATIONKEYS, MROTATIONKEYS, MNUMSCALINGKEYS, MSCALINGKEYS, MPRESTATE, MPOSTSTATE

        The struct member offsets.
    • Constructor Detail

      • AINodeAnim

        public AINodeAnim​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • mNodeName

        public AIString mNodeName()
        Returns a AIString view of the mNodeName field.
      • mNodeName

        public AINodeAnim mNodeName​(java.util.function.Consumer<AIString> consumer)
        Passes the mNodeName field to the specified Consumer.
      • mNumPositionKeys

        public int mNumPositionKeys()
        Returns the value of the mNumPositionKeys field.
      • mNumRotationKeys

        public int mNumRotationKeys()
        Returns the value of the mNumRotationKeys field.
      • mNumScalingKeys

        public int mNumScalingKeys()
        Returns the value of the mNumScalingKeys field.
      • mPreState

        public int mPreState()
        Returns the value of the mPreState field.
      • mPostState

        public int mPostState()
        Returns the value of the mPostState 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​(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.
      • 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​(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.
      • callocStack

        public static AINodeAnim callocStack()
        Returns a new AINodeAnim instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

        public static AINodeAnim callocStack​(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
      • callocStack

        public static AINodeAnim.Buffer callocStack​(int capacity)
        Returns a new AINodeAnim.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static AINodeAnim.Buffer callocStack​(int capacity,
                                                    MemoryStack stack)
        Returns a new AINodeAnim.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nmNodeName

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

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

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

        public static int nmNumScalingKeys​(long struct)
        Unsafe version of mNumScalingKeys().
      • 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.
      • nmNumRotationKeys

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

        public static void nmNumScalingKeys​(long struct,
                                            int value)
        Sets the specified value to the mNumScalingKeys field of the specified struct.
      • 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
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array