Changeset 6282 in orxonox.OLD for trunk/src/world_entities/power_ups
- Timestamp:
- Dec 25, 2005, 4:21:48 PM (19 years ago)
- Location:
- trunk/src/world_entities/power_ups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/power_ups/power_up.cc
r6243 r6282 23 23 using namespace std; 24 24 25 Model* PowerUp::sphereModel = NULL;26 27 25 PowerUp::PowerUp(float r, float g, float b) 28 26 { 29 27 this->respawnType = RESPAWN_NONE; 30 if(!PowerUp::sphereModel) { 31 PowerUp::sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5); 32 } 28 /* if(!PowerUp::sphereModel) {*/ 29 30 Model* sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5); 31 32 this->setModel(sphereModel); 33 this->buildObbTree( 4); 33 34 this->sphereMaterial = new Material; 34 35 this->sphereMaterial->setTransparency(.1); … … 55 56 if(dynamic_cast<Extendable*>(entity)->pickup(this)) 56 57 { 57 this-> setVisibiliy(false);58 this->toList(OM_DEAD_TICK); 58 59 } 59 60 } … … 62 63 void PowerUp::draw() const 63 64 { 64 WorldEntity::draw();65 66 65 glMatrixMode(GL_MODELVIEW); 67 66 glPushMatrix(); 68 float matrix[4][4];69 67 70 68 /* translate */ … … 72 70 this->getAbsCoor ().y, 73 71 this->getAbsCoor ().z); 74 /* rotate */ // FIXME: devise a new Way to rotate this 75 this->getAbsDir ().matrix (matrix); 76 glMultMatrixf((float*)matrix); 72 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 73 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 77 74 78 this->sphereMaterial->select();79 sphereModel->draw();75 this->sphereMaterial->select(); 76 this->getModel(0)->draw(); 80 77 81 glPopMatrix();78 glPopMatrix(); 82 79 } 83 80 -
trunk/src/world_entities/power_ups/power_up.h
r6113 r6282 31 31 virtual void respawn() {}; 32 32 33 static Model* sphereModel;34 35 33 private: 36 34 Material* sphereMaterial;
Note: See TracChangeset
for help on using the changeset viewer.