diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-06-13 14:52:22 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-06-13 14:52:22 +0100 |
| commit | e05bc2828bc213f1e78256f976284bad80722e1a (patch) | |
| tree | e682759db2c253a4649fd6fac96c46be0d386300 /gaunt01/src/bird.h | |
| parent | 8bc09d4264575d2752374413a180bf9dc1b3b035 (diff) | |
avoiding edges version
Diffstat (limited to 'gaunt01/src/bird.h')
| -rw-r--r-- | gaunt01/src/bird.h | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/gaunt01/src/bird.h b/gaunt01/src/bird.h index 3ab0da9..c1f3ac7 100644 --- a/gaunt01/src/bird.h +++ b/gaunt01/src/bird.h @@ -22,22 +22,24 @@ -build basic of time/speed/heading update/draw -basic anim cycle - - - + + + MAKING THE BIRD CHASE THE PLAYERS - + find distance to edge of play - alter turn behaviour depending on how bird needs to head detect player in FOV turn & swoop pick player and remove - + planes frustrum belongs to camera bird checks ray dist to planes avoids nearest +ve */ +#define sign(x) ((x > 0) - (x < 0)) + #include "ofMain.h" #include "morphmesh.h" #include "normBindTexture.h" @@ -51,34 +53,41 @@ class bird public: bird(); virtual ~bird(); - void update(map<int,player>& players,float angle,vector<ofPoint> border); + void update(map<int,player>& players,float angle); void draw(); void drawShadow(); void drawDebug(); + void setBounds(ofPlane* _bounds); + string currentseq; morphmesh model; - + ofRay pointer; ofVec3f position; ofVec2f centrePoint; //2d coords of centre of screen - + + ofVec3f edgepoint; //point where the bird will hit the edge of the screen + float edgelength,edgeangle; + vector<float> playang; vector<float> playhead; vector<float> playdip; vector<float> playdist; vector<ofVec3f> playpos; - + + ofPlane* bounds; + bool leaving; float centrehead; - + float heading; - + protected: private: - + float fieldofview; - + ofVec3f direction; float velocity; //per second @@ -89,7 +98,7 @@ class bird ofImage texture; - + }; |
