Class AIMesh

    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MPRIMITIVETYPES, MNUMVERTICES, MNUMFACES, MVERTICES, MNORMALS, MTANGENTS, MBITANGENTS, MCOLORS, MTEXTURECOORDS, MNUMUVCOMPONENTS, MFACES, MNUMBONES, MBONES, MMATERIALINDEX, MNAME, MNUMANIMMESHES, MANIMMESHES, MMETHOD, MAABB, MTEXTURECOORDSNAMES

        The struct member offsets.
    • Constructor Detail

      • AIMesh

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

        public int mNumVertices()
        The number of vertices in this mesh. This is also the size of all of the per-vertex data arrays. The maximum value for this member is Assimp.AI_MAX_VERTICES.
      • mNumFaces

        public int mNumFaces()
        The number of primitives (triangles, polygons, lines) in this mesh. This is also the size of the mFaces array. The maximum value for this member is Assimp.AI_MAX_FACES.
      • mVertices

        public AIVector3D.Buffer mVertices()
        Vertex positions. This array is always present in a mesh. The array is mNumVertices in size.
      • mNormals

        @Nullable
        public AIVector3D.Buffer mNormals()
        Vertex normals.

        The array contains normalized vectors, NULL if not present. The array is mNumVertices in size. Normals are undefined for point and line primitives. A mesh consisting of points and lines only may not have normal vectors. Meshes with mixed primitive types (i.e. lines and triangles) may have normals, but the normals for vertices that are only referenced by point or line primitives are undefined and set to qNaN.

        Note

        Normal vectors computed by Assimp are always unit-length. However, this needn't apply for normals that have been taken directly from the model file

      • mTangents

        @Nullable
        public AIVector3D.Buffer mTangents()
        Vertex tangents.

        The tangent of a vertex points in the direction of the positive X texture axis. The array contains normalized vectors, NULL if not present. The array is mNumVertices in size. A mesh consisting of points and lines only may not have normal vectors. Meshes with mixed primitive types (i.e. lines and triangles) may have normals, but the normals for vertices that are only referenced by point or line primitives are undefined and set to qNaN.

        Note

        If the mesh contains tangents, it automatically also contains bitangents.

      • mBitangents

        @Nullable
        public AIVector3D.Buffer mBitangents()
        Vertex bitangents.

        The bitangent of a vertex points in the direction of the positive Y texture axis. The array contains normalized vectors, NULL if not present. The array is mNumVertices in size.

        Note

        If the mesh contains tangents, it automatically also contains bitangents.

      • mColors

        public org.lwjgl.PointerBuffer mColors()
        
        @Nullable
        public AIColor4D.Buffer mColors​(int index)
        
        Vertex color sets. A mesh may contain 0 to Assimp.AI_MAX_NUMBER_OF_COLOR_SETS vertex colors per vertex. NULL if not present. Each array is mNumVertices in size if present.
      • mTextureCoords

        public org.lwjgl.PointerBuffer mTextureCoords()
        
        @Nullable
        public AIVector3D.Buffer mTextureCoords​(int index)
        
        Vertex texture coordinates, also known as UV channels. A mesh may contain 0 to Assimp.AI_MAX_NUMBER_OF_TEXTURECOORDS per vertex. NULL if not present. The array is mNumVertices in size.
      • mNumUVComponents

        public java.nio.IntBuffer mNumUVComponents()
        
        public int mNumUVComponents​(int index)
        
        Specifies the number of components for a given UV channel. Up to three channels are supported (UVW, for accessing volume or cube maps). If the value is 2 for a given channel n, the component p.z of mTextureCoords[n][p] is set to 0.0f. If the value is 1 for a given channel, p.y is set to 0.0f, too.

        Note: 4D coordinates are not supported.

      • mFaces

        public AIFace.Buffer mFaces()
        The faces the mesh is constructed from. Each face refers to a number of vertices by their indices. This array is always present in a mesh, its size is given in mNumFaces. If the Assimp.AI_SCENE_FLAGS_NON_VERBOSE_FORMAT is NOT set each face references an unique set of vertices.
      • mNumBones

        public int mNumBones()
        The number of bones this mesh contains. Can be 0, in which case the mBones array is NULL.
      • mBones

        @Nullable
        public org.lwjgl.PointerBuffer mBones()
        The bones of this mesh. A bone consists of a name by which it can be found in the frame hierarchy and a set of vertex weights.
      • mMaterialIndex

        public int mMaterialIndex()
        The material used by this mesh. A mesh uses only a single material. If an imported model uses multiple materials, the import splits up the mesh. Use this value as index into the scene's material list.
      • mName

        public AIString mName()
        Name of the mesh.

        Meshes can be named, but this is not a requirement and leaving this field empty is totally fine. There are mainly three uses for mesh names:

        • some formats name nodes and meshes independently.
        • importers tend to split meshes up to meet the one-material-per-mesh requirement. Assigning the same (dummy) name to each of the result meshes aids the caller at recovering the original mesh partitioning.
        • vertex animations refer to meshes by their names.
      • mNumAnimMeshes

        public int mNumAnimMeshes()
        The number of attachment meshes. Note! Currently only works with Collada loader.
      • mAnimMeshes

        @Nullable
        public org.lwjgl.PointerBuffer mAnimMeshes()
        Attachment meshes for this mesh, for vertex-based animation. Attachment meshes carry replacement data for some of the mesh'es vertex components (usually positions, normals). Note! Currently only works with Collada loader.
      • mAABB

        public AIAABB mAABB()
        the bounding box
      • mPrimitiveTypes

        public AIMesh mPrimitiveTypes​(int value)
        Sets the specified value to the mPrimitiveTypes() field.
      • mNumVertices

        public AIMesh mNumVertices​(int value)
        Sets the specified value to the mNumVertices() field.
      • mColors

        public AIMesh mColors​(org.lwjgl.PointerBuffer value)
        Copies the specified PointerBuffer to the mColors() field.
      • mColors

        public AIMesh 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 AIMesh mTextureCoords​(org.lwjgl.PointerBuffer value)
        Copies the specified PointerBuffer to the mTextureCoords() field.
      • mTextureCoords

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

        public AIMesh mNumUVComponents​(java.nio.IntBuffer value)
        Copies the specified IntBuffer to the mNumUVComponents() field.
      • mNumUVComponents

        public AIMesh mNumUVComponents​(int index,
                                       int value)
        Sets the specified value at the specified index of the mNumUVComponents() field.
      • mBones

        public AIMesh mBones​(@Nullable
                             org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mBones() field.
      • mMaterialIndex

        public AIMesh mMaterialIndex​(int value)
        Sets the specified value to the mMaterialIndex() field.
      • mName

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

        public AIMesh mAnimMeshes​(@Nullable
                                  org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mAnimMeshes() field.
      • mMethod

        public AIMesh mMethod​(int value)
        Sets the specified value to the mMethod() field.
      • mAABB

        public AIMesh mAABB​(java.util.function.Consumer<AIAABB> consumer)
        Passes the mAABB() field to the specified Consumer.
      • mTextureCoordsNames

        public AIMesh mTextureCoordsNames​(@Nullable
                                          org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the mTextureCoordsNames() field.
      • set

        public AIMesh set​(int mPrimitiveTypes,
                          int mNumVertices,
                          AIVector3D.Buffer mVertices,
                          @Nullable
                          AIVector3D.Buffer mNormals,
                          @Nullable
                          AIVector3D.Buffer mTangents,
                          @Nullable
                          AIVector3D.Buffer mBitangents,
                          org.lwjgl.PointerBuffer mColors,
                          org.lwjgl.PointerBuffer mTextureCoords,
                          java.nio.IntBuffer mNumUVComponents,
                          AIFace.Buffer mFaces,
                          @Nullable
                          org.lwjgl.PointerBuffer mBones,
                          int mMaterialIndex,
                          AIString mName,
                          @Nullable
                          org.lwjgl.PointerBuffer mAnimMeshes,
                          int mMethod,
                          AIAABB mAABB,
                          @Nullable
                          org.lwjgl.PointerBuffer mTextureCoordsNames)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

        public static AIMesh.Buffer create​(int capacity)
        Returns a new AIMesh.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

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

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

        @Deprecated
        public static AIMesh mallocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIMesh callocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static AIMesh mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIMesh callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static AIMesh.Buffer mallocStack​(int capacity,
                                                org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
      • callocStack

        @Deprecated
        public static AIMesh.Buffer callocStack​(int capacity,
                                                org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
      • malloc

        public static AIMesh malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new AIMesh instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static AIMesh calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new AIMesh instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

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

        public static AIMesh.Buffer calloc​(int capacity,
                                           org.lwjgl.system.MemoryStack stack)
        Returns a new AIMesh.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
      • nmPrimitiveTypes

        public static int nmPrimitiveTypes​(long struct)
        Unsafe version of mPrimitiveTypes().
      • nmNumVertices

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

        public static int nmNumFaces​(long struct)
        Unsafe version of mNumFaces().
      • nmColors

        public static org.lwjgl.PointerBuffer nmColors​(long struct)
        Unsafe version of mColors().
      • nmColors

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

        public static org.lwjgl.PointerBuffer nmTextureCoords​(long struct)
        Unsafe version of mTextureCoords().
      • nmNumUVComponents

        public static java.nio.IntBuffer nmNumUVComponents​(long struct)
        Unsafe version of mNumUVComponents().
      • nmNumUVComponents

        public static int nmNumUVComponents​(long struct,
                                            int index)
        Unsafe version of mNumUVComponents.
      • nmNumBones

        public static int nmNumBones​(long struct)
        Unsafe version of mNumBones().
      • nmBones

        @Nullable
        public static org.lwjgl.PointerBuffer nmBones​(long struct)
        Unsafe version of mBones.
      • nmMaterialIndex

        public static int nmMaterialIndex​(long struct)
        Unsafe version of mMaterialIndex().
      • nmName

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

        public static int nmNumAnimMeshes​(long struct)
        Unsafe version of mNumAnimMeshes().
      • nmAnimMeshes

        @Nullable
        public static org.lwjgl.PointerBuffer nmAnimMeshes​(long struct)
        Unsafe version of mAnimMeshes.
      • nmMethod

        public static int nmMethod​(long struct)
        Unsafe version of mMethod().
      • nmAABB

        public static AIAABB nmAABB​(long struct)
        Unsafe version of mAABB().
      • nmTextureCoordsNames

        @Nullable
        public static org.lwjgl.PointerBuffer nmTextureCoordsNames​(long struct)
        Unsafe version of mTextureCoordsNames.
      • nmPrimitiveTypes

        public static void nmPrimitiveTypes​(long struct,
                                            int value)
        Unsafe version of mPrimitiveTypes.
      • nmNumVertices

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

        public static void nmNumFaces​(long struct,
                                      int value)
        Sets the specified value to the mNumFaces field of the specified struct.
      • nmColors

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

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

        public static void nmTextureCoords​(long struct,
                                           org.lwjgl.PointerBuffer value)
        Unsafe version of mTextureCoords.
      • nmNumUVComponents

        public static void nmNumUVComponents​(long struct,
                                             java.nio.IntBuffer value)
        Unsafe version of mNumUVComponents.
      • nmNumUVComponents

        public static void nmNumUVComponents​(long struct,
                                             int index,
                                             int value)
        Unsafe version of mNumUVComponents.
      • nmFaces

        public static void nmFaces​(long struct,
                                   AIFace.Buffer value)
        Unsafe version of mFaces.
      • nmNumBones

        public static void nmNumBones​(long struct,
                                      int value)
        Sets the specified value to the mNumBones field of the specified struct.
      • nmBones

        public static void nmBones​(long struct,
                                   @Nullable
                                   org.lwjgl.PointerBuffer value)
        Unsafe version of mBones.
      • nmMaterialIndex

        public static void nmMaterialIndex​(long struct,
                                           int value)
        Unsafe version of mMaterialIndex.
      • nmName

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

        public static void nmNumAnimMeshes​(long struct,
                                           int value)
        Sets the specified value to the mNumAnimMeshes field of the specified struct.
      • nmAnimMeshes

        public static void nmAnimMeshes​(long struct,
                                        @Nullable
                                        org.lwjgl.PointerBuffer value)
        Unsafe version of mAnimMeshes.
      • nmMethod

        public static void nmMethod​(long struct,
                                    int value)
        Unsafe version of mMethod.
      • nmAABB

        public static void nmAABB​(long struct,
                                  AIAABB value)
        Unsafe version of mAABB.
      • nmTextureCoordsNames

        public static void nmTextureCoordsNames​(long struct,
                                                @Nullable
                                                org.lwjgl.PointerBuffer value)
        Unsafe version of mTextureCoordsNames.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate