From ef785f976ec359de78e8bc3bed2283bcde65ddaa Mon Sep 17 00:00:00 2001 From: LockedLunatic Date: Wed, 15 Apr 2015 01:26:56 +0200 Subject: [PATCH] in the midst of changes --- Weave/Graphix/MetaModel.cpp | 7 ++++++- Weave/Graphix/Model.cpp | 1 - Weave/Graphix/Model.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Weave/Graphix/MetaModel.cpp b/Weave/Graphix/MetaModel.cpp index 8ca79d0..ffd6b8a 100644 --- a/Weave/Graphix/MetaModel.cpp +++ b/Weave/Graphix/MetaModel.cpp @@ -26,7 +26,10 @@ MetaModel::MetaModel(const string& modelpath) Model* tmp_model=nullptr; for (unsigned int i = 0; i < scene->mNumMeshes; i++) { - models.push_back(new Model(scene->mMeshes[i])); + + aiMatrix4x4 transform = scene->mRootNode->mChildren[i]->mTransformation; + + models.push_back(new Model(scene->mMeshes[i]), transform); } } @@ -35,6 +38,8 @@ MetaModel::MetaModel(const string& modelpath) Message::error("The file " + modelpath + " doesn't contain any nodes."); return; } + + } MetaModel::~MetaModel() diff --git a/Weave/Graphix/Model.cpp b/Weave/Graphix/Model.cpp index 23bb731..aa1998b 100644 --- a/Weave/Graphix/Model.cpp +++ b/Weave/Graphix/Model.cpp @@ -257,6 +257,5 @@ bool Model::import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float* normals[3 * i + 2] = mesh->mNormals[i].z; } - return true; } diff --git a/Weave/Graphix/Model.h b/Weave/Graphix/Model.h index 82bb41e..bd39ae6 100644 --- a/Weave/Graphix/Model.h +++ b/Weave/Graphix/Model.h @@ -19,7 +19,7 @@ class Model { public: Model(const string& modelpath, unsigned int index=0); - Model(const aiMesh* mesh); + Model(const aiMesh* mesh, const aiMatrix4x4 modelmatrix); Model(unsigned int numvertices, unsigned int numfaces, float *vertex, float *uvs, float *normals, unsigned int *index); virtual ~Model(); -- 2.47.3