From: Peter Schaefer Date: Mon, 20 Jun 2016 21:44:03 +0000 (+0200) Subject: Trigger Eventbox X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=96174fa93d6851a1db5f2b81e2a99a644ac34a67;p=cgue_weave.git Trigger Eventbox --- diff --git a/Weave/Scene/EventBox.cpp b/Weave/Scene/EventBox.cpp index 4047f50..aa250a3 100644 --- a/Weave/Scene/EventBox.cpp +++ b/Weave/Scene/EventBox.cpp @@ -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) { diff --git a/Weave/Scene/EventBox.h b/Weave/Scene/EventBox.h index 7bf1f55..f0e6ca1 100644 --- a/Weave/Scene/EventBox.h +++ b/Weave/Scene/EventBox.h @@ -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; }; diff --git a/Weave/Scene/Marvin.cpp b/Weave/Scene/Marvin.cpp index 743ba50..273d68d 100644 --- a/Weave/Scene/Marvin.cpp +++ b/Weave/Scene/Marvin.cpp @@ -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)) + { + + } }