]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
added DeadTextur for BOAR
authorPeter Schaefer <schaeferpm@gmail.com>
Tue, 28 Jun 2016 03:21:14 +0000 (05:21 +0200)
committerPeter Schaefer <schaeferpm@gmail.com>
Tue, 28 Jun 2016 03:21:14 +0000 (05:21 +0200)
deaktivated DEAD Animations for BOAR (cant undo timeshift)

Weave/Scene/Boar.cpp
Weave/Scene/Boar.h
textures/model_boar_dead_2D.png [new file with mode: 0644]

index 275b2504189d92438d74afb396446638b9747fc1..016d8c0ae4aadb41d6473a47efe1adaa2270a500 100644 (file)
@@ -2,6 +2,9 @@
 #include "../GLM.h"
 
 #include "../Message.h"
+#include "../Graphix/Textures.h"
+#include "../Graphix/Model.h"
+#include "../Graphix/Shader.h"
 
 Boar::Boar(const mat4& _modelMat) :
        SceneObject(_modelMat, vec4(7.0f, 0.7f, 1.0f, 3.0f), "boar", "model_boar_2D.png")
@@ -9,6 +12,9 @@ Boar::Boar(const mat4& _modelMat) :
        collide_group = COL_ENEMY;
        collide_with = COL_LEVEL | COL_MARVIN;
        yStatic = false;
+
+       texture_dead = Texture::newTImage("model_boar_dead_2D.png", vec4(7.0f, 0.7f, 1.0f, 3.0f));
+       texture_dead->bindTexture();
 }
 
 
@@ -42,9 +48,9 @@ void Boar::update(float _deltaT)
 
        btTransform tmp;
        
-       if(!alive)
-               tmp.setFromOpenGLMatrix(value_ptr(translate(vec3(0.f, .3f, 0.f))*modelMat));
-       else
+       //if(!alive)
+       //      tmp.setFromOpenGLMatrix(value_ptr(translate(vec3(0.f, .3f, 0.f))*modelMat));
+       //else
                tmp.setFromOpenGLMatrix(value_ptr(modelMat));
        bt_collision_object->setWorldTransform(tmp);
        yFloorDist = 100;
@@ -58,6 +64,42 @@ void Boar::update(float _deltaT)
        }
 }
 
+//void Boar::draw(drawTarget _target) const
+//{
+//     switch (_target)
+//     {
+//     case DRAW_ModelMotionBlur:
+//             //upload new->old model
+//             Shader::getShader(SH_ACTIVE)->setUniformLocation("uCur2OldModel", oldModelMat * glm::inverse(modelMat));
+//     case DRAW_Model:
+//     default:
+//             if (alive)
+//                     texture->useTexture();
+//             else
+//                     texture_dead->useTexture();
+//
+//             if (timeresistant)
+//                     Shader::getShader(SH_ACTIVE)->setUniformLocation("uAddGlow", true);
+//             model->drawModel(modelMat, dr_Model, vec4(0.9f, 0.f, 0.f, 1.f), currentAnimation, AnimationTime);
+//             if (timeresistant)
+//                     Shader::getShader(SH_ACTIVE)->setUniformLocation("uAddGlow", false);
+//             break;
+//     case DRAW_Wire:
+//             if (alive)
+//                     texture->useTexture();
+//             else
+//                     texture_dead->useTexture();
+//             model->drawModel(modelMat, dr_WireT, vec4(0.9f, 0.f, 0.f, 1.f), currentAnimation, AnimationTime);
+//             break;
+//     case DRAW_Coll:
+//             if (collision != nullptr)
+//                     collision->drawModel(modelMat, dr_WireC, vec4(0.9f, 0.f, 0.f, 1.f), currentAnimation, AnimationTime);
+//             break;
+//     }
+//     /* Draw Object*/
+//
+//}
+
 void Boar::collides(SceneObject * _other, btPersistentManifold * _contactManifold, float _deltaT)
 {
        if (_other->collide_group != COL_MARVIN && _other->collide_group != COL_ENEMY)
index 5708c8130376a13ea7a5a0fe7e79eb39a2044f77..fc3b8079a5fdf5373b4289b1b2ee51f3d3a5528a 100644 (file)
@@ -11,6 +11,7 @@ public:
        ~Boar();
 
        virtual void update(float) override;
+       //virtual void draw(drawTarget target = DRAW_Model) const override;
 
        virtual void collides(SceneObject* other, btPersistentManifold* contactManifold, float deltaT = 1.f) override;
 
@@ -19,5 +20,7 @@ protected:
        bool nextFrame = true;
 
        bool alive = true;
+
+       Texture* texture_dead;
 };
 
diff --git a/textures/model_boar_dead_2D.png b/textures/model_boar_dead_2D.png
new file mode 100644 (file)
index 0000000..dfb11bb
Binary files /dev/null and b/textures/model_boar_dead_2D.png differ