Changeset 4597 in orxonox.OLD for orxonox/trunk/src/world_entities/satellite.cc
- Timestamp:
- Jun 11, 2005, 12:55:48 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/satellite.cc
r4320 r4597 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 13 13 ### File Specific: 14 14 main-programmer: Patrick Boenzli 15 co-programmer: 15 co-programmer: 16 16 */ 17 17 … … 32 32 { 33 33 this->setClassID(CL_SATELLITE, "Satellite"); 34 34 35 this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL); 35 36 this->speed = speed; … … 52 53 \brief this method is called every frame 53 54 \param time: the time in seconds that has passed since the last tick 54 55 55 56 Handle all stuff that should update with time inside this method (movement, animation, etc.) 56 57 */ 57 void Satellite::tick(float time) 58 void Satellite::tick(float time) 58 59 { 59 60 float w = this->speed * M_PI; 60 61 61 Quaternion rotation(w * time, *this->axis); 62 Quaternion rotation(w * time, *this->axis); 62 63 Quaternion v = this->getRelDir(); 63 64 64 65 this->setRelDir(v * rotation); 65 66 } … … 68 69 /** 69 70 \brief the entity is drawn onto the screen with this function 70 71 71 72 This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn. 72 73 */ 73 void Satellite::draw() 74 void Satellite::draw() 74 75 { 75 76 glMatrixMode(GL_MODELVIEW); 76 77 glPushMatrix(); 77 78 float matrix[4][4]; 78 79 79 80 /* translate */ 80 glTranslatef (this->getAbsCoor ().x, 81 this->getAbsCoor ().y, 82 81 glTranslatef (this->getAbsCoor ().x, 82 this->getAbsCoor ().y, 83 this->getAbsCoor ().z); 83 84 /* rotate */ 84 85 this->getAbsDir ().matrix (matrix); 85 86 glMultMatrixf((float*)matrix); 86 87 87 88 this->model->draw(); 88 89 glPopMatrix();
Note: See TracChangeset
for help on using the changeset viewer.