summaryrefslogtreecommitdiff
path: root/gaunt01/src/trapdoor.h
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-03-31 16:44:02 +0100
committerTim Redfern <tim@eclectronics.org>2012-03-31 16:44:02 +0100
commit0e8f0361c1068eb4c2f634dfcf4e1762d87f40d2 (patch)
tree96a4eb154c1ac2dbe5ad4e04d4e33b281832e441 /gaunt01/src/trapdoor.h
parent623e1924aeea83ea70c8ae7f645b067f17a293ea (diff)
implementing trap door
Diffstat (limited to 'gaunt01/src/trapdoor.h')
-rw-r--r--gaunt01/src/trapdoor.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/gaunt01/src/trapdoor.h b/gaunt01/src/trapdoor.h
new file mode 100644
index 0000000..16ad3b1
--- /dev/null
+++ b/gaunt01/src/trapdoor.h
@@ -0,0 +1,46 @@
+#ifndef TRAPDOOR_H
+#define TRAPDOOR_H
+
+#include "ofMain.h"
+#include "morphmesh.h"
+#include "normBindTexture.h"
+
+/*
+const vector<ofxCvBlob>& blobs
+
+receive vector of player positions
+needs to 'debounce' - time threshold for activation
+
+creaking sound player
+*/
+
+class trapdoor
+{
+ public:
+ trapdoor(ofRectangle boundingRect=ofRectangle(0,0,100,100),ofVec2f _doorSize=ofVec2f(10,10));
+ virtual ~trapdoor();
+
+ void checkUpdate(const vector<ofVec3f>& players);
+ void draw();
+ void start();
+
+ protected:
+ private:
+ morphmesh surround;
+ morphmesh lid;
+
+ ofVec2f position;
+
+ float startTime;
+ float triggerTime; //time threshold
+
+ ofRectangle boundingRect;
+ ofVec2f doorSize;
+
+ float doorAngle;
+
+ ofImage texture;
+
+};
+
+#endif // TRAPDOOR_H