From d829e008102a025ecc59ced915f30c2519d1b5cc Mon Sep 17 00:00:00 2001 From: LockedLunatic Date: Tue, 14 Apr 2015 02:19:29 +0200 Subject: [PATCH] barely different from before --- Weave/Game.cpp | 6 +++--- Weave/Game.h | 2 +- Weave/Graphix/Model.cpp | 2 +- Weave/Graphix/SceneObject.cpp | 4 ++-- Weave/Graphix/SceneObject.h | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Weave/Game.cpp b/Weave/Game.cpp index cccf0cb..6f6bc1e 100644 --- a/Weave/Game.cpp +++ b/Weave/Game.cpp @@ -85,7 +85,7 @@ Game::Game() : playing(true) tmp_Scene->addObject(new SceneObject(shader1, translate(vec3(1.f, 0.f, 1.f)), "cow/cow.dae", "model_cow.jpg")); //tmp_Scene->addObject(new SceneObject(shader1, translate(vec3(-1.f, 2.f, -2.f)), "../models/box/box.dae", "../Textures/sky_withstars.png")); //tmp_Scene->addObject(new SceneObject(shader1, translate(vec3(1.f, 3.f, -2.f)), "../models/cow/cow.dae", "../models/cow/texture.jpg")); - import("level_test.dae", *tmp_Scene, shader1); + //import("level_test.dae", tmp_Scene, shader1); } @@ -173,7 +173,7 @@ void Game::draw() const } -bool Game::import(const string& path, Scene& scene, Shader* shader) +bool Game::import(const string& path, Scene* scene, Shader* shader) { Assimp::Importer importer; @@ -234,7 +234,7 @@ bool Game::import(const string& path, Scene& scene, Shader* shader) delete vertex, normals, uvs, index; //TODO enable different textures - scene.addObject(new SceneObject(shader, translate(vec3(1.f, 0.f, 1.f)), model, "model_cow.jpg")); + scene->addObject(new SceneObject(shader, translate(vec3(1.f, 0.f, 1.f)), model, "model_cow.jpg")); //file->mRootNode->mChildren[n]->mTransformation.a1 ... d4 } } else diff --git a/Weave/Game.h b/Weave/Game.h index f90a314..b024fc6 100644 --- a/Weave/Game.h +++ b/Weave/Game.h @@ -36,7 +36,7 @@ private: void update(float); void draw() const; - bool import(const string &path, Scene &scene, Shader* shader); + bool import(const string &path, Scene *scene, Shader* shader); }; diff --git a/Weave/Graphix/Model.cpp b/Weave/Graphix/Model.cpp index e75c03c..4df9478 100644 --- a/Weave/Graphix/Model.cpp +++ b/Weave/Graphix/Model.cpp @@ -149,7 +149,7 @@ bool Model::import(const string& path,uint& numvertices, uint& numfaces, float*& { Assimp::Importer importer; - const aiScene* scene = importer.ReadFile("../models/" + path, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType | aiProcess_PreTransformVertices); + const aiScene* scene = importer.ReadFile("../models/" + path, aiProcess_GenUVCoords | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType); //aiProcess_PreTransformVertices if (!scene) { Message::error("The file " + path + " couldn't be read.\n" + importer.GetErrorString()); diff --git a/Weave/Graphix/SceneObject.cpp b/Weave/Graphix/SceneObject.cpp index 46aed7e..eb13c78 100644 --- a/Weave/Graphix/SceneObject.cpp +++ b/Weave/Graphix/SceneObject.cpp @@ -21,7 +21,7 @@ using std::string; using std::cout; using std::endl; -SceneObject::SceneObject(Shader* _shader, mat4& _model, string _modelpath, string texturepath, float _matter, float _speed, float _atack, vec3& _direction) : +SceneObject::SceneObject(Shader* _shader, mat4& _model, string _modelpath, string texturepath) : Model(_modelpath), model(_model), shader(_shader), @@ -36,7 +36,7 @@ texture(nullptr) bindShader(shader); } -SceneObject::SceneObject(Shader* _shader, mat4& _model, Model* model_obj, string texturepath, float _matter, float _speed, float _atack, vec3& _direction) : +SceneObject::SceneObject(Shader* _shader, mat4& _model, Model* model_obj, string texturepath) : Model(*model_obj), model(_model), shader(_shader), diff --git a/Weave/Graphix/SceneObject.h b/Weave/Graphix/SceneObject.h index 150041e..5a93c49 100644 --- a/Weave/Graphix/SceneObject.h +++ b/Weave/Graphix/SceneObject.h @@ -22,8 +22,8 @@ class SceneObject : public: //SceneObject(Shader* _shader, mat4& model); - SceneObject(Shader* _shader, mat4& model, string modelpath, string texturepath, float matter = 1.f, float speed = 1.f, float atack = 1.f, vec3& direction = vec3(0.f)); - SceneObject(Shader* _shader, mat4& model, Model* model_obj, string texturepath, float matter = 1.f, float speed = 1.f, float atack = 1.f, vec3& direction = vec3(0.f)); + SceneObject(Shader* _shader, mat4& model, string modelpath, string texturepath); + SceneObject(Shader* _shader, mat4& model, Model* model_obj, string texturepath); virtual ~SceneObject(); virtual void update(float); -- 2.47.3