]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
added Margin -> doesnt fix glitches
authorPeter Schaefer <schaeferpm@gmail.com>
Thu, 25 Jun 2015 20:01:42 +0000 (22:01 +0200)
committerPeter Schaefer <schaeferpm@gmail.com>
Thu, 25 Jun 2015 20:01:42 +0000 (22:01 +0200)
Weave/Graphix/Graphix.cpp
Weave/Graphix/Model/IMetaMesh.cpp
Weave/Graphix/Model/IMetaMesh.h
Weave/Graphix/Model/Model.cpp
Weave/Graphix/Model/Model.h
Weave/Scene/Marvin.cpp
Weave/Scene/SceneObject.cpp
Weave/Scene/SceneObject.h

index 5f5d40a4781af727b63323807237214e79b8eb5d..cfe9e34452d7079a53f36cae5092ffab7f1be0cb 100644 (file)
@@ -251,6 +251,6 @@ SDL_Window* Graphix::sdl_window;
 
 SDL_GLContext Graphix::sdl_glcontext;
 
-short Graphix::effects = EF_NOTHING;
+short Graphix::effects = EF_TRANSPARENCY;
 
 Shader* Graphix::shader_BBox;
index ee47474fc51e491569943fc8b7538188917b87e5..9308f4ac7cf6268cd6160de8d6d921feafa991a5 100644 (file)
@@ -117,4 +117,12 @@ void IMetaMesh::drawBBox(const mat4& _modelMat,const vec4& _color) const
 IMetaMesh::operator string() const
 {
        return modelpath;
+}
+
+void IMetaMesh::setMargin(btScalar _margin)
+{
+       for (auto i = models.begin(); i != models.end(); ++i)
+       {
+               i->first->setMargin(_margin);
+       }
 }
\ No newline at end of file
index 50a2b1f11212e39d303639201e8b73816fdfb490..b7363e95dd7437979a537eaa8f8f25f0e5cb3919 100644 (file)
@@ -25,6 +25,8 @@ public:
 
        operator std::string() const override;
 
+       void setMargin(btScalar margin) override;
+
 protected:
 
        std::string modelpath;
index c1244e0821e49b5fc6c0d9aab2f4b69725b0ab76..50683758361a72070eb9333ca34d0e822a1e531e 100644 (file)
@@ -379,6 +379,11 @@ bool Model::import(const aiMesh* mesh, uint& numvertices, uint& numfaces, float*
        return true;
 }
 
+void Model::setMargin(btScalar _margin)
+{
+       bt_collision_shape->setMargin(_margin);
+}
+
 
 Model* Model::BoundingBox = nullptr;
 Model* Model::SkyBoxModel = nullptr;
index 499d2a1695d296ffdbde36d1a6b0e72083170971..ff7a4cb5a0de5bf833cb2dfc08debe00dc5035d7 100644 (file)
@@ -33,7 +33,7 @@ public:
        /* Get size&position from BBox */
        void getBBcs(vec3& center, vec3& size) const;
 
-       class Triangle;
+       virtual void setMargin(btScalar margin);
 
        static Model* getBBoxModel();
        static Model* getSkyBoxModel();
index 1d4bbd6ef800e90dab4656e93b9b1ec610349331..f8b314ab73bd513cc6af211675b9c81d040f1f37 100644 (file)
@@ -17,6 +17,7 @@ SceneObject(_shader, _modelMat, vec4(7.0f, 0.7f, 1.0f, 3.0f), "Player.dae", "mod
 {
        collide_group = COL_MARVIN;
        collide_with = COL_LEVEL | COL_ENEMY | COL_EVENT;
+
 }
 
 
index cd2a3cf7750e0550bd867669d36140feb9a8444e..f1ba7fa6205a4106b81907e0ca942a3c2c2286a2 100644 (file)
@@ -174,6 +174,11 @@ void SceneObject::update(float deltaT)
        yFloorDist = 100;
 }
 
+void SceneObject::setMargin(btScalar _margin)
+{
+       model->setMargin(_margin);
+}
+
 void SceneObject::draw() const
 {
        //      useModel(shader);
index ba15fbe0dfeef97285d925c344dee2ab874156e5..358d3e6b68c21df8179eacb1c1a4bee06e5b047d 100644 (file)
@@ -49,6 +49,8 @@ public:
        virtual void turnTo(vec3& direction, float speed = 1);
        virtual void move(vec3& dist);
 
+       void setMargin(btScalar margin);
+
        //virtual bool operator==(SceneObject);
 
        __declspec(deprecated)