Class AIMeshAnim

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

    public class AIMeshAnim
    extends Struct
    implements NativeResource
    Describes vertex-based animations for a single mesh or a group of meshes. Meshes carry the animation data for each frame in their AIMesh::mAnimMeshes array. The purpose of aiMeshAnim is to define keyframes linking each mesh attachment to a particular point in time.

    Member documentation

    • mName – Name of the mesh to be animated. An empty string is not allowed, animated meshes need to be named (not necessarily uniquely, the name can basically serve as wildcard to select a group of meshes with similar animation setup)
    • mNumKeys – Size of the mKeys array. Must be 1, at least.
    • mKeys – Key frames of the animation. May not be NULL.

    Layout

    
     struct aiMeshAnim {
         struct aiString mName;
         unsigned int mNumKeys;
         struct aiMeshKey * mKeys;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MNAME, MNUMKEYS, MKEYS

        The struct member offsets.
    • Constructor Detail

      • AIMeshAnim

        public AIMeshAnim​(java.nio.ByteBuffer container)
        Creates a AIMeshAnim 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 AIMeshAnim mName​(java.util.function.Consumer<AIString> consumer)
        Passes the mName field to the specified Consumer.
      • mNumKeys

        public int mNumKeys()
        Returns the value of the mNumKeys field.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

        public static int nmNumKeys​(long struct)
        Unsafe version of mNumKeys().
      • nmName

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

        public static void nmNumKeys​(long struct,
                                     int value)
        Sets the specified value to the mNumKeys 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