46 #ifndef INCLUDED_AI_MESH_H 47 #define INCLUDED_AI_MESH_H 64 #ifndef AI_MAX_FACE_INDICES 65 # define AI_MAX_FACE_INDICES 0x7fff 71 #ifndef AI_MAX_BONE_WEIGHTS 72 # define AI_MAX_BONE_WEIGHTS 0x7fffffff 78 #ifndef AI_MAX_VERTICES 79 # define AI_MAX_VERTICES 0x7fffffff 86 # define AI_MAX_FACES 0x7fffffff 92 #ifndef AI_MAX_NUMBER_OF_COLOR_SETS 93 # define AI_MAX_NUMBER_OF_COLOR_SETS 0x8 94 #endif // !! AI_MAX_NUMBER_OF_COLOR_SETS 99 #ifndef AI_MAX_NUMBER_OF_TEXTURECOORDS 100 # define AI_MAX_NUMBER_OF_TEXTURECOORDS 0x8 101 #endif // !! AI_MAX_NUMBER_OF_TEXTURECOORDS 166 ::memcpy( mIndices, o.
mIndices, mNumIndices *
sizeof(
unsigned int));
176 bool operator== (
const aiFace& o)
const 178 if (mIndices == o.
mIndices)
return true;
182 if (mIndices[i] != o.
mIndices[i])
return false;
190 bool operator != (
const aiFace& o)
const 192 return !(*
this == o);
194 #endif // __cplusplus 219 : mVertexId( pID), mWeight( pWeight)
222 #endif // __cplusplus 259 : mName( other.
mName )
275 #endif // __cplusplus 328 #define AI_PRIMITIVE_TYPE_FOR_N_INDICES(n) \ 329 ((n) > 3 ? aiPrimitiveType_POLYGON : (aiPrimitiveType)(1u << ((n)-1))) 385 , mBitangents( NULL )
390 mTextureCoords[a] = NULL;
402 delete [] mBitangents;
404 delete [] mTextureCoords[a];
407 delete [] mColors[a];
413 bool HasPositions()
const {
414 return mVertices != NULL;
419 bool HasNormals()
const {
420 return mNormals != NULL;
426 bool HasTangentsAndBitangents()
const {
427 return mTangents != NULL;
433 bool HasVertexColors(
unsigned int pIndex)
const {
440 bool HasTextureCoords(
unsigned int pIndex)
const {
614 : mPrimitiveTypes( 0 )
620 , mBitangents( NULL )
624 , mMaterialIndex( 0 )
625 , mNumAnimMeshes( 0 )
626 , mAnimMeshes( NULL )
630 mNumUVComponents[a] = 0;
631 mTextureCoords[a] = NULL;
644 delete [] mBitangents;
646 delete [] mTextureCoords[a];
649 delete [] mColors[a];
653 if (mNumBones && mBones) {
654 for(
unsigned int a = 0; a < mNumBones; a++) {
660 if (mNumAnimMeshes && mAnimMeshes) {
661 for(
unsigned int a = 0; a < mNumAnimMeshes; a++) {
662 delete mAnimMeshes[a];
664 delete [] mAnimMeshes;
673 bool HasPositions()
const 674 {
return mVertices != NULL && mNumVertices > 0; }
678 bool HasFaces()
const 679 {
return mFaces != NULL && mNumFaces > 0; }
682 bool HasNormals()
const 683 {
return mNormals != NULL && mNumVertices > 0; }
689 bool HasTangentsAndBitangents()
const 690 {
return mTangents != NULL && mBitangents != NULL && mNumVertices > 0; }
694 bool HasVertexColors(
unsigned int pIndex)
const 699 return mColors[pIndex] != NULL && mNumVertices > 0;
704 bool HasTextureCoords(
unsigned int pIndex)
const 709 return mTextureCoords[pIndex] != NULL && mNumVertices > 0;
713 unsigned int GetNumUVChannels()
const 721 unsigned int GetNumColorChannels()
const 729 inline bool HasBones()
const 730 {
return mBones != NULL && mNumBones > 0; }
732 #endif // __cplusplus 739 #endif // __AI_MESH_H_INC unsigned int mPrimitiveTypes
Bitwise combination of the members of the aiPrimitiveType enum.
Definition: mesh.h:474
float mWeight
The strength of the influence in the range (0...1).
Definition: mesh.h:208
A triangular primitive.
Definition: mesh.h:307
C_STRUCT aiString mName
The name of the bone.
Definition: mesh.h:236
Basic data types and primitives, such as vectors or colors.
C_STRUCT aiVector3D * mTangents
Replacement for aiMesh::mTangents.
Definition: mesh.h:358
Definition: matrix4x4.h:236
#define AI_MAX_NUMBER_OF_COLOR_SETS
Supported number of vertex color sets per mesh.
Definition: mesh.h:93
A mesh represents a geometry or model with a single material.
Definition: mesh.h:467
C_STRUCT aiFace * mFaces
The faces the mesh is constructed from.
Definition: mesh.h:567
unsigned int mNumVertices
The number of vertices in the aiAnimMesh, and thus the length of all the member arrays.
Definition: mesh.h:377
C_STRUCT aiVector3D * mVertices
Replacement for aiMesh::mVertices.
Definition: mesh.h:352
NOT CURRENTLY IN USE.
Definition: mesh.h:344
#define AI_MAX_NUMBER_OF_TEXTURECOORDS
Supported number of texture coord sets (UV(W) channels) per mesh.
Definition: mesh.h:100
A single bone of a mesh.
Definition: mesh.h:233
unsigned int mMaterialIndex
The material used by this mesh.
Definition: mesh.h:585
unsigned int mNumBones
The number of bones this mesh contains.
Definition: mesh.h:572
C_STRUCT aiString mName
Name of the mesh.
Definition: mesh.h:598
C_STRUCT aiVector3D * mNormals
Replacement for aiMesh::mNormals.
Definition: mesh.h:355
This value is not used.
Definition: mesh.h:323
A higher-level polygon with more than 3 edges.
Definition: mesh.h:316
unsigned int * mIndices
Pointer to the indices array. Size of the array is given in numIndices.
Definition: mesh.h:132
A single face in a mesh, referring to multiple vertices.
Definition: mesh.h:125
C_STRUCT aiBone ** mBones
The bones of this mesh.
Definition: mesh.h:578
Represents an UTF-8 string, zero byte terminated.
Definition: types.h:251
C_STRUCT aiVector3D * mVertices
Vertex positions.
Definition: mesh.h:492
C_STRUCT aiVector3D * mTangents
Vertex tangents.
Definition: mesh.h:528
C_STRUCT aiAnimMesh ** mAnimMeshes
NOT CURRENTLY IN USE.
Definition: mesh.h:607
unsigned int mNumAnimMeshes
NOT CURRENTLY IN USE.
Definition: mesh.h:602
A line primitive.
Definition: mesh.h:301
Definition: vector3.h:134
C_STRUCT aiVertexWeight * mWeights
The vertices affected by this bone.
Definition: mesh.h:243
C_STRUCT aiVector3D * mNormals
Vertex normals.
Definition: mesh.h:514
aiPrimitiveType
Enumerates the types of geometric primitives supported by Assimp.
Definition: mesh.h:287
unsigned int mNumIndices
Number of indices defining this face.
Definition: mesh.h:129
A single influence of a bone on a vertex.
Definition: mesh.h:201
C_STRUCT aiVector3D * mBitangents
Replacement for aiMesh::mBitangents.
Definition: mesh.h:361
unsigned int mNumVertices
The number of vertices in this mesh.
Definition: mesh.h:480
unsigned int mNumWeights
The number of vertices affected by this bone The maximum value for this member is AI_MAX_BONE_WEIGHTS...
Definition: mesh.h:240
unsigned int mNumFaces
The number of primitives (triangles, polygons, lines) in this mesh.
Definition: mesh.h:486
unsigned int mVertexId
Index of the vertex which is influenced by the bone.
Definition: mesh.h:204
C_STRUCT aiMatrix4x4 mOffsetMatrix
Matrix that transforms from mesh space to bone space in bind pose.
Definition: mesh.h:246
A point primitive.
Definition: mesh.h:294
C_STRUCT aiVector3D * mBitangents
Vertex bitangents.
Definition: mesh.h:537