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);
}
}
Message::error("The file " + modelpath + " doesn't contain any nodes.");
return;
}
+
+
}
MetaModel::~MetaModel()
{
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();