summaryrefslogtreecommitdiff
path: root/gaunt01/src/bird.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gaunt01/src/bird.cpp')
-rw-r--r--gaunt01/src/bird.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/gaunt01/src/bird.cpp b/gaunt01/src/bird.cpp
index a6dfcf8..49567bc 100644
--- a/gaunt01/src/bird.cpp
+++ b/gaunt01/src/bird.cpp
@@ -30,11 +30,11 @@ bird::bird()
turnRate=20;
diveRate=0;
-
+
fieldofview=60;
lastTime=ofGetElapsedTimef();
-
+
centrePoint=ofVec2f(ofGetWidth()/2,600); //quick and dirty
}
@@ -52,18 +52,18 @@ void bird::update(map<int,player>& players, float angle,vector<ofPoint> border){
while (heading <-180) heading=heading+360;
position-=direction.rotated(heading,ofVec3f(0,0,-1))*velocity*timeSeg; //.rotate(heading,ofVec3f(0,1,0))
-
+
//absolute ray pointer
pointer=ofRay(position.rotated(angle,ofVec3f(1,0,0)),-direction.rotated(heading,ofVec3f(0,0,-1)).rotated(angle,ofVec3f(1,0,0))*1000.0f,false);
ofRay relpointer=ofRay(position,-direction.rotated(heading,ofVec3f(0,0,-1))*1000.0f,false);
-
+
playang.clear();
playdist.clear();
playpos.clear();
playhead.clear();
playdip.clear();
-
+
map<int,player>::iterator it;
for (it=players.begin();it!=players.end();it++) {
if (it->second.active) {
@@ -83,7 +83,8 @@ void bird::update(map<int,player>& players, float angle,vector<ofPoint> border){
centrehead=atan2(position.x-centrePoint.x,position.y-centrePoint.y)*RAD_TO_DEG;
while (centrehead>180) centrehead=centrehead-360;
while (centrehead <-180) centrehead=centrehead+360;
- if (OutsidePolygon(border,futurepoint)) {
+
+ if (0) { //OutsidePolygon(border,futurepoint)) {
//if (ofVec
leaving=true;
turnRate=centrehead/5;
@@ -101,7 +102,7 @@ void bird::update(map<int,player>& players, float angle,vector<ofPoint> border){
}
if (nearest>-1) turnRate=-playhead[nearest];
}
-
+
}
void bird::draw(){
glEnable(GL_DEPTH_TEST);