Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
|
enum aiMorphingMethod More...
#include <mesh.h>
Public Member Functions | |
aiMesh () AI_NO_EXCEPT | |
Default constructor. Initializes all members to 0. More... | |
unsigned int | GetNumColorChannels () const |
Get the number of vertex color channels the mesh contains. More... | |
unsigned int | GetNumUVChannels () const |
Get the number of UV channels the mesh contains. More... | |
const aiString * | GetTextureCoordsName (unsigned int pIndex) const |
Get a texture coordinate set name. More... | |
bool | HasBones () const |
Check whether the mesh contains bones. More... | |
bool | HasFaces () const |
Check whether the mesh contains faces. More... | |
bool | HasNormals () const |
Check whether the mesh contains normal vectors. More... | |
bool | HasPositions () const |
Check whether the mesh contains positions. More... | |
bool | HasTangentsAndBitangents () const |
Check whether the mesh contains tangent and bitangent vectors It is not possible that it contains tangents and no bitangents (or the other way round). More... | |
bool | HasTextureCoords (unsigned int pIndex) const |
Check whether the mesh contains a texture coordinate set. More... | |
bool | HasTextureCoordsName (unsigned int pIndex) const |
Check whether the mesh contains a texture coordinate set name. More... | |
bool | HasVertexColors (unsigned int pIndex) const |
Check whether the mesh contains a vertex color set. More... | |
void | SetTextureCoordsName (unsigned int pIndex, const aiString &texCoordsName) |
Set a texture coordinate set name. More... | |
~aiMesh () | |
Deletes all storage allocated for the mesh. More... | |
Public Attributes | |
C_STRUCT aiAABB | mAABB |
The bounding box. More... | |
C_STRUCT aiAnimMesh ** | mAnimMeshes |
Attachment meshes for this mesh, for vertex-based animation. More... | |
C_STRUCT aiVector3D * | mBitangents |
Vertex bitangents. More... | |
C_STRUCT aiBone ** | mBones |
The bones of this mesh. More... | |
C_STRUCT aiColor4D * | mColors [AI_MAX_NUMBER_OF_COLOR_SETS] |
Vertex color sets. More... | |
C_STRUCT aiFace * | mFaces |
The faces the mesh is constructed from. More... | |
unsigned int | mMaterialIndex |
The material used by this mesh. More... | |
unsigned int | mMethod |
Method of morphing when anim-meshes are specified. More... | |
C_STRUCT aiString | mName |
Name of the mesh. More... | |
C_STRUCT aiVector3D * | mNormals |
Vertex normals. More... | |
unsigned int | mNumAnimMeshes |
The number of attachment meshes. More... | |
unsigned int | mNumBones |
The number of bones this mesh contains. More... | |
unsigned int | mNumFaces |
The number of primitives (triangles, polygons, lines) in this mesh. More... | |
unsigned int | mNumUVComponents [AI_MAX_NUMBER_OF_TEXTURECOORDS] |
Specifies the number of components for a given UV channel. More... | |
unsigned int | mNumVertices |
The number of vertices in this mesh. More... | |
unsigned int | mPrimitiveTypes |
Bitwise combination of the members of the aiPrimitiveType enum. More... | |
C_STRUCT aiVector3D * | mTangents |
Vertex tangents. More... | |
C_STRUCT aiVector3D * | mTextureCoords [AI_MAX_NUMBER_OF_TEXTURECOORDS] |
Vertex texture coordinates, also known as UV channels. More... | |
C_STRUCT aiString ** | mTextureCoordsNames |
Vertex UV stream names. More... | |
C_STRUCT aiVector3D * | mVertices |
Vertex positions. More... | |
enum aiMorphingMethod
A mesh represents a geometry or model with a single material.
It usually consists of a number of vertices and a series of primitives/faces referencing the vertices. In addition there might be a series of bones, each of them addressing a number of vertices with a certain weight. Vertex data is presented in channels with each channel containing a single per-vertex information such as a set of texture coordinates or a normal vector. If a data pointer is non-null, the corresponding data stream is present. From C++-programs you can also use the comfort functions Has*() to test for the presence of various data streams.
A Mesh uses only a single material which is referenced by a material ID.
|
inline |
Default constructor. Initializes all members to 0.
|
inline |
Deletes all storage allocated for the mesh.
|
inline |
Get the number of vertex color channels the mesh contains.
|
inline |
Get the number of UV channels the mesh contains.
|
inline |
Get a texture coordinate set name.
pIndex | Index of the texture coordinates set |
|
inline |
Check whether the mesh contains bones.
|
inline |
Check whether the mesh contains faces.
If no special scene flags are set this should always return true
|
inline |
Check whether the mesh contains normal vectors.
|
inline |
Check whether the mesh contains positions.
Provided no special scene flags are set, this will always be true
|
inline |
Check whether the mesh contains tangent and bitangent vectors It is not possible that it contains tangents and no bitangents (or the other way round).
The existence of one of them implies that the second is there, too.
|
inline |
Check whether the mesh contains a texture coordinate set.
pIndex | Index of the texture coordinates set |
|
inline |
Check whether the mesh contains a texture coordinate set name.
pIndex | Index of the texture coordinates set |
|
inline |
Check whether the mesh contains a vertex color set.
pIndex | Index of the vertex color set |
|
inline |
Set a texture coordinate set name.
pIndex | Index of the texture coordinates set |
texCoordsName | name of the texture coordinate set |
C_STRUCT aiAnimMesh** aiMesh::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.
C_STRUCT aiVector3D* aiMesh::mBitangents |
Vertex bitangents.
The bitangent of a vertex points in the direction of the positive Y texture axis. The array contains normalized vectors, nullptr if not present. The array is mNumVertices in size.
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.
C_STRUCT aiColor4D* aiMesh::mColors[AI_MAX_NUMBER_OF_COLOR_SETS] |
Vertex color sets.
A mesh may contain 0 to AI_MAX_NUMBER_OF_COLOR_SETS vertex colors per vertex. nullptr if not present. Each array is mNumVertices in size if present.
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 AI_SCENE_FLAGS_NON_VERBOSE_FORMAT is NOT set each face references an unique set of vertices.
unsigned int aiMesh::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.
unsigned int aiMesh::mMethod |
Method of morphing when anim-meshes are specified.
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:
C_STRUCT aiVector3D* aiMesh::mNormals |
Vertex normals.
The array contains normalized vectors, nullptr 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 (WARN: qNaN compares to inequal to everything, even to qNaN itself. Using code like this to check whether a field is qnan is:
still dangerous because even 1.f == 1.f could evaluate to false! ( remember the subtleties of IEEE754 artithmetics). Use stuff like fpclassify
instead.
unsigned int aiMesh::mNumAnimMeshes |
The number of attachment meshes.
Note! Currently only works with Collada loader.
unsigned int aiMesh::mNumBones |
The number of bones this mesh contains.
Can be 0, in which case the mBones array is nullptr.
unsigned int aiMesh::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 AI_MAX_FACES.
unsigned int aiMesh::mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS] |
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.
unsigned int aiMesh::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 AI_MAX_VERTICES.
unsigned int aiMesh::mPrimitiveTypes |
Bitwise combination of the members of the aiPrimitiveType enum.
This specifies which types of primitives are present in the mesh. The "SortByPrimitiveType"-Step can be used to make sure the output meshes consist of one primitive type each.
C_STRUCT aiVector3D* aiMesh::mTangents |
Vertex tangents.
The tangent of a vertex points in the direction of the positive X texture axis. The array contains normalized vectors, nullptr 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. See the mNormals member for a detailed discussion of qNaNs.
C_STRUCT aiVector3D* aiMesh::mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS] |
Vertex texture coordinates, also known as UV channels.
A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per vertex. nullptr if not present. The array is mNumVertices in size.
Vertex UV stream names.
Pointer to array of size AI_MAX_NUMBER_OF_TEXTURECOORDS
C_STRUCT aiVector3D* aiMesh::mVertices |
Vertex positions.
This array is always present in a mesh. The array is mNumVertices in size.