Added mesh name importing to .X ascii format.
parent
daabf4bf86
commit
328cae8a81
|
@ -110,6 +110,7 @@ struct Bone
|
|||
/** Helper structure to represent an XFile mesh */
|
||||
struct Mesh
|
||||
{
|
||||
std::string mName;
|
||||
std::vector<aiVector3D> mPositions;
|
||||
std::vector<Face> mPosFaces;
|
||||
std::vector<aiVector3D> mNormals;
|
||||
|
@ -124,7 +125,7 @@ struct Mesh
|
|||
|
||||
std::vector<Bone> mBones;
|
||||
|
||||
Mesh() { mNumTextures = 0; mNumColorSets = 0; }
|
||||
Mesh(const std::string &pName = "") { mName = pName; mNumTextures = 0; mNumColorSets = 0; }
|
||||
};
|
||||
|
||||
/** Helper structure to represent a XFile frame */
|
||||
|
|
|
@ -294,6 +294,9 @@ void XFileImporter::CreateMeshes( aiScene* pScene, aiNode* pNode, const std::vec
|
|||
mesh->mNumFaces = (unsigned int)faces.size();
|
||||
mesh->mFaces = new aiFace[mesh->mNumFaces];
|
||||
|
||||
// name
|
||||
mesh->mName.Set(sourceMesh->mName);
|
||||
|
||||
// normals?
|
||||
if( sourceMesh->mNormals.size() > 0)
|
||||
mesh->mNormals = new aiVector3D[numVertices];
|
||||
|
|
|
@ -414,7 +414,7 @@ void XFileParser::ParseDataObjectFrame( Node* pParent)
|
|||
else
|
||||
if( objectName == "Mesh")
|
||||
{
|
||||
Mesh* mesh = new Mesh;
|
||||
Mesh* mesh = new Mesh(name);
|
||||
node->mMeshes.push_back( mesh);
|
||||
ParseDataObjectMesh( mesh);
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue