Changeset 3408 in orxonox.OLD for orxonox/branches/dave/src/skybox.cc
- Timestamp:
- Feb 18, 2005, 4:56:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/dave/src/skybox.cc
r3407 r3408 11 11 #include "skybox.h" 12 12 #include "stdincl.h" 13 #include "vector.h" 13 14 #include "world_entity.h" 14 #include "vector.h"15 15 16 16 17 17 using namespace std; 18 18 19 Skybox::Skybox() :WorldEntity()19 Skybox::Skybox() 20 20 { 21 21 //GLUquadricObj *sphereObj=0; … … 27 27 Skybox::~Skybox(){} 28 28 29 void Skybox::tick(float time){30 this->move(time);31 }32 33 void Skybox::hit(WorldEntity* weapon,Vector loc){}34 35 void Skybox::destroy(){}36 37 void Skybox::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitlags){}38 39 void Skybox::command(Command* cmd)40 {41 if(!strcmp(cmd->cmd, "up")) bUp=!cmd->bUp;42 else if(!strcmp(cmd->cmd,"down"))bDown=!cmd->bUp;43 else if(!strcmp(cmd->cmd,"left"))bLeft=!cmd->bUp;44 else if(!strcmp(cmd->cmd,"right"))bRight=!cmd->bUp;45 29 46 30 47 }48 31 49 50 void Skybox::draw() 32 void Skybox::draw(WorldEntity* myplayer) 51 33 { 52 34 53 35 glPushMatrix(); 54 glTranslatef(this->getAbsCoor().x,this->getAbsCoor().y,this->getAbsCoor().z); 55 glRotatef(180.0f,0.0f,0.0f,1.0f); 56 glRotatef(45.0f,0.0,1.0f,0.0f); 36 //Vector shift(myplayer->getRelCoor()); 37 //glTranslatef(shift.x,shift.y,shift.z); 38 glTranslatef(myplayer->absCoordinate.x,myplayer->absCoordinate.y,myplayer->absCoordinate.z); 39 glRotatef(-180.0f,0.0f,0.0f,1.0f); 40 glRotatef(0.0f,0.0,1.0f,0.0f); 57 41 gluSphere(sphereObj,250.0f,20,20); 58 42 glPopMatrix(); 59 60 61 }62 63 void Skybox::leftWorld(){}64 65 void Skybox::move(float time)66 {67 Vector accel(0.0,0.0,0.0);68 Vector direction (1.0,0.0,0.0);69 Vector orthDirection (0.0,0.0,1.0);70 71 if(bUp){accel=accel+(direction*20.0f);}72 if(bDown){accel=accel-(direction*20.0f);}73 if(bLeft){accel=accel-(orthDirection*20.0f);}74 if(bRight){accel=accel+(orthDirection*20.0f);}75 76 Vector shift(15.0f*time,0,0);77 this->shiftCoor(&shift);78 Vector move=accel*time;79 this->shiftCoor(&move);80 81 82 83 84 43 85 44 … … 90 49 91 50 51 52 53
Note: See TracChangeset
for help on using the changeset viewer.