]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
barely different from before
authorLockedLunatic <locked.lunatic@aon.at>
Tue, 14 Apr 2015 00:19:29 +0000 (02:19 +0200)
committerLockedLunatic <locked.lunatic@aon.at>
Tue, 14 Apr 2015 00:19:29 +0000 (02:19 +0200)
Weave/Game.cpp
Weave/Game.h
Weave/Graphix/Model.cpp
Weave/Graphix/SceneObject.cpp
Weave/Graphix/SceneObject.h

index cccf0cbe4ad61950e922917ba0ffabd621134425..6f6bc1e3a27f7b211576b8fc509fe40248785c42 100644 (file)
@@ -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
index f90a314fcafd822ab2aa9ce41f5ee8ad254c2ce9..b024fc6a53f2166a3c6c0332b2e328ee2e4b5210 100644 (file)
@@ -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);
 
 };
 
index e75c03ccbcca1b872bd764a09b813c55cc3a911b..4df9478e3ff092e5e3c15f0187c1395ede769787 100644 (file)
@@ -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());
index 46aed7e116d1e46cbce4c87824dc5347ce6132b6..eb13c789ec3aaafc3ddb1aaafa8f44376e5e5801 100644 (file)
@@ -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),
index 150041ee58a8cf28b8ee399bf1f3258cf23f92db..5a93c4935856edeed8d1022272b7c0aa1b763f99 100644 (file)
@@ -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);