Changeset 6269 in orxonox.OLD for branches/powerups
- Timestamp:
- Dec 23, 2005, 2:42:54 AM (19 years ago)
- Location:
- branches/powerups/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/powerups/src/world_entities/extendable.h
r6113 r6269 17 17 class Extendable : virtual public BaseObject { 18 18 19 public: 20 // Extendable(); 21 // virtual ~Extendable(); 19 public: 20 // virtual ~Extendable(); 22 21 virtual bool pickup(PowerUp* powerUp) { return false; }; 23 22 24 private: 23 protected: 24 Extendable() { this->setClassID(CL_EXTENDABLE, "Extendable"); }; 25 26 private: 25 27 26 28 }; -
branches/powerups/src/world_entities/power_ups/power_up.cc
r6243 r6269 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 -
branches/powerups/src/world_entities/power_ups/power_up.h
r6113 r6269 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.