]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
Trigger Eventbox
authorPeter Schaefer <schaeferpm@gmail.com>
Mon, 20 Jun 2016 21:44:03 +0000 (23:44 +0200)
committerPeter Schaefer <schaeferpm@gmail.com>
Mon, 20 Jun 2016 21:44:03 +0000 (23:44 +0200)
Weave/Scene/EventBox.cpp
Weave/Scene/EventBox.h
Weave/Scene/Marvin.cpp

index 4047f508ec816aaf2d54db1a5e6b4bb9e9f67f86..aa250a32475001c3e377be93a47d6ab460a0ed92 100644 (file)
@@ -14,7 +14,7 @@
 #include "../GLM.h"
 
 
-EventBox::EventBox(const mat4& _modelMat, uint _EB_TYPE) : 
+EventBox::EventBox(const mat4& _modelMat, eventBoxType _EB_TYPE) : 
        SceneObject( _modelMat, vec4(0.f), Model::getBBoxModel(), ""),
        eb_type(_EB_TYPE)
 {
index 7bf1f55113018adde9dddd0f35cf8c375a809473..f0e6ca1f9f9cb2ceab909207e2d19393180c044f 100644 (file)
@@ -3,17 +3,17 @@
 #include "SceneObject.h"
 #include "../GLM.h"
 
-
-#define EB_WINZONE 1
-#define EB_LOSTZONE 2
-
-typedef unsigned int uint;
+enum eventBoxType {
+       EB_WINZONE = 0,
+       EB_LOSTZONE = 1,
+       EB_TRIGGER = 2
+};
 
 class EventBox :
        public SceneObject
 {
 public:
-       EventBox(const mat4& modelMat, uint EB_TYPE=0);
+       EventBox(const mat4& modelMat, eventBoxType EB_TYPE);
        ~EventBox();
 
        virtual void update(float) override;
@@ -22,5 +22,6 @@ public:
        virtual void collides(SceneObject* other, btPersistentManifold* contactManifold, float deltaT = 1.f) override;
 
 protected:
-       uint eb_type;
+       eventBoxType eb_type;
+       SceneObject* trigger;
 };
index 743ba50207a426ad713e53e93cd1167f69fda383..273d68de0f160e11bbe2968a0c9329787c7be23a 100644 (file)
@@ -64,6 +64,12 @@ void Marvin::update(float deltaT)
                //Rotate Play in move direction
                if (move_x || move_y)
                        turnTo(cam.getWorldDirection(), 3 * deltaT / TIME_TILL_DIRECTION_ROTATE);
+
+               //hit E
+               if (Events::isKHeld(SDLK_e))
+               {
+
+               }
        }