Class AIAnimation

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


    public class AIAnimation
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.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

        public static final int SIZEOF
        The struct size in bytes.
    • 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • 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.
      • mChannels

        public org.lwjgl.PointerBuffer mChannels()
        Returns a PointerBuffer view of the data pointed to by the mChannels field.
      • mNumMeshChannels

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

        public org.lwjgl.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.
      • mChannels

        public AIAnimation mChannels(org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mChannels field.
      • mMeshChannels

        public AIAnimation mMeshChannels(org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mMeshChannels field.
      • set

        public AIAnimation set(AIString mName,
                               double mDuration,
                               double mTicksPerSecond,
                               org.lwjgl.PointerBuffer mChannels,
                               org.lwjgl.PointerBuffer mMeshChannels)
        Initializes this struct with the specified values.
      • set

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

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

        public static AIAnimation calloc()
        Returns a new AIAnimation instance allocated with memCalloc. The instance must be explicitly freed.
      • 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.
      • malloc

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

        public static AIAnimation.Buffer calloc(int capacity)
        Returns a new AIAnimation.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • 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.
      • mallocStack

        public static AIAnimation mallocStack()
        Returns a new AIAnimation instance allocated on the thread-local MemoryStack.
      • callocStack

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

        public static AIAnimation mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new AIAnimation instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static AIAnimation callocStack(org.lwjgl.system.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
      • mallocStack

        public static AIAnimation.Buffer mallocStack(int capacity)
        Returns a new AIAnimation.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • 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
      • mallocStack

        public static AIAnimation.Buffer mallocStack(int capacity,
                                                     org.lwjgl.system.MemoryStack stack)
        Returns a new AIAnimation.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static AIAnimation.Buffer callocStack(int capacity,
                                                     org.lwjgl.system.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
      • 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 AIAnimation.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