From: LockedLunatic Date: Tue, 14 Apr 2015 23:26:56 +0000 (+0200) Subject: in the midst of changes X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=ef785f976ec359de78e8bc3bed2283bcde65ddaa;p=cgue_weave.git in the midst of changes --- 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();