From 09fba466578c1074bf7471bbc4615a9047237d46 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 19 Apr 2012 02:14:26 +0100 Subject: bird chasing players --- gaunt01/src/bird.h | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'gaunt01/src/bird.h') diff --git a/gaunt01/src/bird.h b/gaunt01/src/bird.h index abcd66f..026da72 100644 --- a/gaunt01/src/bird.h +++ b/gaunt01/src/bird.h @@ -26,6 +26,15 @@ 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 */ @@ -34,23 +43,37 @@ #include "normBindTexture.h" #include "player.h" +#include "ofxRay.h" class bird { public: bird(); virtual ~bird(); - void update(const map& players); + void update(map& players,float angle); void draw(); void drawShadow(); + void drawDebug(); string currentseq; morphmesh model; + + ofRay pointer; + ofVec3f position; + + vector playang; + vector playhead; + vector playdip; + vector playdist; + vector playpos; + + float heading; + protected: private: - - ofVec3f position; - float heading; + + float fieldofview; + ofVec3f direction; float velocity; //per second @@ -61,6 +84,7 @@ class bird ofImage texture; + }; -- cgit v1.2.3