#ifndef TRAPDOOR_H #define TRAPDOOR_H #include "ofMain.h" #include "morphmesh.h" #include "normBindTexture.h" #include "player.h" /* const vector& blobs receive vector of player positions needs to 'debounce' - time threshold for activation creaking sound player */ class trapdoor { public: trapdoor(ofVec2f pos=ofVec2f(0,0),float _doorSize=10); virtual ~trapdoor(); bool checkUpdate(map& players); void draw(); void drawSplash(float angle); void drawDebug(); vector getCorners(); ofVec2f bounds2UV(ofVec2f pt); void setBoundingRect(float x,float y, float width,float height); ofRectangle getBoundingRect(); ofRectangle getInnerRect(); void trigger(); float getoffset(); float getFalldist(); ofImage* splashFrames; //temp public bool active; protected: private: morphmesh surround; morphmesh beneath; morphmesh lid; ofVec2f position; float size; ofRectangle boundingRect; ofVec2f doorSize; float doorAngle; float doorSpeed; ofImage texture; float triggeredTime; vector caught; vector caughtTime; }; #endif // TRAPDOOR_H