Class AIAnimMesh

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

    public class AIAnimMesh
    extends Struct
    implements NativeResource
    An AnimMesh is an attachment to an AIMesh stores per-vertex animations for a particular frame.

    You may think of an aiAnimMesh as a `patch` for the host mesh, which replaces only certain vertex data streams at a particular time. Each mesh stores n attached attached meshes (AIMesh::mAnimMeshes). The actual relationship between the time line and anim meshes is established by aiMeshAnim, which references singular mesh attachments by their ID and binds them to a time offset.

    Member documentation

    • mName – the AnimMesh name
    • mVertices – Replacement for AIMesh::mVertices. If this array is non-NULL, it *must* contain mNumVertices entries. The corresponding array in the host mesh must be non-NULL as well - animation meshes may neither add or nor remove vertex components (if a replacement array is NULL and the corresponding source array is not, the source data is taken instead).
    • mNormals – Replacement for AIMesh::mNormals.
    • mTangents – Replacement for AIMesh::mTangents.
    • mBitangents – Replacement for AIMesh::mBitangents.
    • mColors[Assimp.AI_MAX_NUMBER_OF_COLOR_SETS] – Replacement for AIMesh::mColors
    • mTextureCoords[Assimp.AI_MAX_NUMBER_OF_TEXTURECOORDS] – Replacement for AIMesh::mTextureCoords
    • mNumVertices – The number of vertices in the aiAnimMesh, and thus the length of all the member arrays. This has always the same value as the mNumVertices property in the corresponding AIMesh. It is duplicated here merely to make the length of the member arrays accessible even if the aiMesh is not known, e.g. from language bindings.
    • mWeight – Weight of the AnimMesh.

    Layout

    
     struct aiAnimMesh {
         struct aiString mName;
         struct aiVector3D * mVertices;
         struct aiVector3D * mNormals;
         struct aiVector3D * mTangents;
         struct aiVector3D * mBitangents;
         struct aiColor4D * mColors[Assimp.AI_MAX_NUMBER_OF_COLOR_SETS];
         struct aiVector3D * mTextureCoords[Assimp.AI_MAX_NUMBER_OF_TEXTURECOORDS];
         unsigned int mNumVertices;
         float mWeight;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MNAME, MVERTICES, MNORMALS, MTANGENTS, MBITANGENTS, MCOLORS, MTEXTURECOORDS, MNUMVERTICES, MWEIGHT

        The struct member offsets.
    • Constructor Detail

      • AIAnimMesh

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

        @Nullable
        public AIColor4D.Buffer mColors​(int index)
        Returns a AIColor4D view of the pointer at the specified index of the mColors field.
      • mTextureCoords

        @Nullable
        public AIVector3D.Buffer mTextureCoords​(int index)
        Returns a AIVector3D view of the pointer at the specified index of the mTextureCoords field.
      • mNumVertices

        public int mNumVertices()
        Returns the value of the mNumVertices field.
      • mWeight

        public float mWeight()
        Returns the value of the mWeight field.
      • mName

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

        public AIAnimMesh mColors​(int index,
                                  @Nullable
                                  AIColor4D.Buffer value)
        Copies the address of the specified AIColor4D at the specified index of the mColors field.
      • mColors

        public AIAnimMesh mColors​(int index,
                                  java.util.function.Consumer<AIColor4D.Buffer> consumer)
        Passes the element at index of the mColors field to the specified Consumer.
      • mTextureCoords

        public AIAnimMesh mTextureCoords​(int index,
                                         @Nullable
                                         AIVector3D.Buffer value)
        Copies the address of the specified AIVector3D at the specified index of the mTextureCoords field.
      • mTextureCoords

        public AIAnimMesh mTextureCoords​(int index,
                                         java.util.function.Consumer<AIVector3D.Buffer> consumer)
        Passes the element at index of the mTextureCoords field to the specified Consumer.
      • mNumVertices

        public AIAnimMesh mNumVertices​(int value)
        Sets the specified value to the mNumVertices field.
      • mWeight

        public AIAnimMesh mWeight​(float value)
        Sets the specified value to the mWeight field.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        @Nullable
        public static AIColor4D.Buffer nmColors​(long struct,
                                                int index)
        Unsafe version of mColors.
      • nmNumVertices

        public static int nmNumVertices​(long struct)
        Unsafe version of mNumVertices().
      • nmWeight

        public static float nmWeight​(long struct)
        Unsafe version of mWeight().
      • nmName

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

        public static void nmColors​(long struct,
                                    PointerBuffer value)
        Unsafe version of mColors.
      • nmColors

        public static void nmColors​(long struct,
                                    int index,
                                    @Nullable
                                    AIColor4D.Buffer value)
        Unsafe version of mColors.
      • nmNumVertices

        public static void nmNumVertices​(long struct,
                                         int value)
        Sets the specified value to the mNumVertices field of the specified struct.
      • nmWeight

        public static void nmWeight​(long struct,
                                    float value)
        Unsafe version of mWeight.