Class AIAnimation

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

    public class AIAnimation
    extends Struct
    implements NativeResource
    An animation consists of keyframe data for a number of nodes. For each node affected by the animation a separate series of data is given.

    Member documentation

    • mName – The name of the animation. If the modeling package this data was exported from does support only a single animation channel, this name is usually empty (length is zero).
    • mDuration – Duration of the animation in ticks.
    • mTicksPerSecond – Ticks per second. 0 if not specified in the imported file
    • mNumChannels – The number of bone animation channels. Each channel affects a single node.
    • mChannels – The node animation channels. Each channel affects a single node. The array is mNumChannels in size.
    • mNumMeshChannels – The number of mesh animation channels. Each channel affects a single mesh and defines vertex-based animation.
    • mMeshChannels – The mesh animation channels. Each channel affects a single mesh. The array is mNumMeshChannels in size.

    Layout

    
     struct aiAnimation {
         struct aiString mName;
         double mDuration;
         double mTicksPerSecond;
         unsigned int mNumChannels;
         struct aiNodeAnim ** mChannels;
         unsigned int mNumMeshChannels;
         struct aiMeshAnim ** mMeshChannels;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MNAME, MDURATION, MTICKSPERSECOND, MNUMCHANNELS, MCHANNELS, MNUMMESHCHANNELS, MMESHCHANNELS

        The struct member offsets.
    • Constructor Detail

      • AIAnimation

        public AIAnimation​(java.nio.ByteBuffer container)
        Creates a AIAnimation 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
      • mName

        public AIAnimation mName​(java.util.function.Consumer<AIString> consumer)
        Passes the mName field to the specified Consumer.
      • mDuration

        public double mDuration()
        Returns the value of the mDuration field.
      • mTicksPerSecond

        public double mTicksPerSecond()
        Returns the value of the mTicksPerSecond field.
      • mNumChannels

        public int mNumChannels()
        Returns the value of the mNumChannels field.
      • mNumMeshChannels

        public int mNumMeshChannels()
        Returns the value of the mNumMeshChannels field.
      • mMeshChannels

        public PointerBuffer mMeshChannels()
        Returns a PointerBuffer view of the data pointed to by the mMeshChannels field.
      • mDuration

        public AIAnimation mDuration​(double value)
        Sets the specified value to the mDuration field.
      • mTicksPerSecond

        public AIAnimation mTicksPerSecond​(double value)
        Sets the specified value to the mTicksPerSecond field.
      • set

        public AIAnimation set​(AIAnimation src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • create

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

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

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

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

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

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

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

        public static AIAnimation.Buffer callocStack​(int capacity,
                                                     MemoryStack stack)
        Returns a new AIAnimation.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
      • nmName

        public static AIString nmName​(long struct)
        Unsafe version of mName().
      • nmDuration

        public static double nmDuration​(long struct)
        Unsafe version of mDuration().
      • nmTicksPerSecond

        public static double nmTicksPerSecond​(long struct)
        Unsafe version of mTicksPerSecond().
      • nmNumChannels

        public static int nmNumChannels​(long struct)
        Unsafe version of mNumChannels().
      • nmNumMeshChannels

        public static int nmNumMeshChannels​(long struct)
        Unsafe version of mNumMeshChannels().
      • nmName

        public static void nmName​(long struct,
                                  AIString value)
        Unsafe version of mName.
      • nmDuration

        public static void nmDuration​(long struct,
                                      double value)
        Unsafe version of mDuration.
      • nmTicksPerSecond

        public static void nmTicksPerSecond​(long struct,
                                            double value)
        Unsafe version of mTicksPerSecond.
      • nmNumChannels

        public static void nmNumChannels​(long struct,
                                         int value)
        Sets the specified value to the mNumChannels field of the specified struct.
      • nmChannels

        public static void nmChannels​(long struct,
                                      PointerBuffer value)
        Unsafe version of mChannels.
      • nmNumMeshChannels

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