Assimp  v4.1. (December 2018)
assimp::mesh::aiMesh Struct Reference

A mesh represents a geometry or model with a single material. More...

Public Attributes

aiAnimMesh ** mAnimMeshes
 NOT CURRENTLY IN USE. More...
 
aiVector3DmBitangents
 Vertex bitangents. More...
 
aiBone ** mBones
 The bones of this mesh. More...
 
aiColor4DmColors [AI_MAX_NUMBER_OF_COLOR_SETS]
 Vertex color sets. More...
 
aiFacemFaces
 The faces the mesh is contstructed from. More...
 
uint mMaterialIndex
 The material used by this mesh. More...
 
aiString mName
 Name of the mesh. More...
 
aiVector3DmNormals
 Vertex normals. More...
 
uint mNumAnimMeshes
 NOT CURRENTLY IN USE. The number of attachment meshes. More...
 
uint mNumBones
 The number of bones this mesh contains. More...
 
uint mNumFaces
 The number of primitives (triangles, polygons, lines) in this mesh. More...
 
uint mNumUVComponents [AI_MAX_NUMBER_OF_TEXTURECOORDS]
 Specifies the number of components for a given UV channel. More...
 
uint mNumVertices
 The number of vertices in this mesh. More...
 
uint mPrimitiveTypes
 Bitwise combination of aiPrimitiveType members. More...
 
aiVector3DmTangents
 Vertex tangents. More...
 
aiVector3DmTextureCoords [AI_MAX_NUMBER_OF_TEXTURECOORDS]
 Vertex texture coords, also known as UV channels. More...
 
aiVector3DmVertices
 Vertex positions. More...
 

Detailed Description

A mesh represents a geometry or model with a single material.

It usually consists of a number of vertices and a series 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 coords or a normal vector. If a data pointer is non-null, the corresponding data stream is present.

A mesh uses only a single material which is referenced by a material ID.

Note: The mPositions member is usually not optional. However, vertex positions could be missing if the AI_SCENE_FLAGS_INCOMPLETE flag is set in aiScene.mFlags.

Member Data Documentation

◆ mAnimMeshes

aiAnimMesh** assimp::mesh::aiMesh::mAnimMeshes

NOT CURRENTLY IN USE.

Attachment meshes for this mesh, for vertex- based animation.

Attachment meshes carry replacement data for some of the mesh's vertex components (usually positions, normals).

◆ mBitangents

aiVector3D* assimp::mesh::aiMesh::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.

◆ mBones

aiBone** assimp::mesh::aiMesh::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.

◆ mColors

aiColor4D* assimp::mesh::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. null if not present.

Each array is mNumVertices in size if present.

◆ mFaces

aiFace* assimp::mesh::aiMesh::mFaces

The faces the mesh is contstructed 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.

◆ mMaterialIndex

uint assimp::mesh::aiMesh::mMaterialIndex

The material used by this mesh.

A mesh does use 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

aiString assimp::mesh::aiMesh::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.

◆ mNormals

aiVector3D* assimp::mesh::aiMesh::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.

◆ mNumAnimMeshes

uint assimp::mesh::aiMesh::mNumAnimMeshes

NOT CURRENTLY IN USE. The number of attachment meshes.

◆ mNumBones

uint assimp::mesh::aiMesh::mNumBones

The number of bones this mesh contains.

Can be 0, in which case the mBones array is null.

◆ mNumFaces

uint assimp::mesh::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.

◆ mNumUVComponents

uint assimp::mesh::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. If the value is 1 for a given channel, p.y is set to 0, too. If this value is 0, 2 should be assumed.

Note: 4D coords are not supported.

◆ mNumVertices

uint assimp::mesh::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.

◆ mPrimitiveTypes

uint assimp::mesh::aiMesh::mPrimitiveTypes

Bitwise combination of aiPrimitiveType members.

This specifies which types of primitives are present in the mesh. The SortByPrimitiveType post processing step can be used to make sure the output meshes consist of one primitive type each.

◆ mTangents

aiVector3D* assimp::mesh::aiMesh::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 (the bitangent is just the cross product of tangent and normal vectors).

◆ mTextureCoords

aiVector3D* assimp::mesh::aiMesh::mTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS]

Vertex texture coords, also known as UV channels.

A mesh may contain 0 to AI_MAX_NUMBER_OF_TEXTURECOORDS per vertex. null if not present.

Each array is mNumVertices in size.

◆ mVertices

aiVector3D* assimp::mesh::aiMesh::mVertices

Vertex positions.

This array is always present in a mesh. The array is mNumVertices in size.


The documentation for this struct was generated from the following file: