#include "bird.h" bird::bird() { model.loadMesh("Bird-test.xml"); texture.loadImage("TextureBird.jpg"); //starting pos position=ofVec3f(ofGetWidth()/2,ofGetHeight()/3,ofGetHeight()/2); heading=ofVec3f(-1,0,0); direction=ofVec3f(-1,0,0); velocity=ofGetWidth()/100; turnAngle=0; diveAngle=0; lastTime=ofGetElapsedTimef(); } bird::~bird() { //dtor } void bird::update(const vector& players){ float time=ofGetElapsedTimef(); float timeSeg=time-lastTime; lastTime=time; position+=direction*velocity*timeSeg; } void bird::draw(){ ofPushMatrix(); ofTranslate(position); //ofRotate(direction); ofRotate(90,0,-1,0); //ofRotate(180,1,0,0); bindTexture(texture); model.draw(); unbindTexture(texture); ofPopMatrix(); }