Merge pull request #588 from zippers/master

Added mesh name importing to .X ascii format.
pull/591/merge
Kim Kulling 2015-06-21 11:45:43 +02:00
commit 71cc64238a
3 changed files with 6 additions and 2 deletions

View File

@ -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 */

View File

@ -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];

View File

@ -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