summaryrefslogtreecommitdiff
path: root/gaunt01/src/trapdoor.h
blob: 43121e39080a9867a59a45426771c681cf1817fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#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;
		float doorSpeed;
	
		ofImage texture;
		
};

#endif // TRAPDOOR_H