Changeset 5437 in orxonox.OLD for trunk/src/world_entities/power_ups
- Timestamp:
- Oct 26, 2005, 11:01:43 PM (19 years ago)
- Location:
- trunk/src/world_entities/power_ups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/power_ups/turret_power_up.cc
r5435 r5437 20 20 #include "list.h" 21 21 22 #include "primitive_model.h" 23 22 24 using namespace std; 23 25 24 26 CREATE_FACTORY(TurretPowerUp); 25 26 GLUquadricObj* TurretPowerUp_sphereObj = NULL;27 Material* TurretPowerUp_sphereMat = NULL;28 29 27 30 28 TurretPowerUp::TurretPowerUp () … … 41 39 42 40 43 TurretPowerUp::~TurretPowerUp () { 44 41 TurretPowerUp::~TurretPowerUp () 42 { 43 delete this->sphereModel; 44 delete this->sphereMaterial; 45 45 } 46 46 … … 51 51 this->loadModelWithScale("models/guns/turret1.obj", 2.0); 52 52 53 if (TurretPowerUp_sphereObj == NULL) 54 TurretPowerUp_sphereObj = gluNewQuadric(); 55 if(TurretPowerUp_sphereMat == NULL) 56 { 57 TurretPowerUp_sphereMat = new Material("TurretPowerUp_Sphere"); 58 TurretPowerUp_sphereMat->setTransparency(.1); 59 } 53 this->sphereModel = new PrimitiveModel(PRIM_SPHERE, 7, 5); 54 this->sphereMaterial = new Material; 55 this->sphereMaterial->setTransparency(.0001); 56 this->sphereMaterial->setDiffuse(.1, .1, .8); 57 60 58 this->rotation = Vector(0,1,0); 61 this->cycle = 0; 59 this->cycle = (float)rand()/RAND_MAX*M_2_PI; 60 this->shiftDir(Quaternion((float)rand()/RAND_MAX*M_2_PI, this->rotation)); 62 61 } 63 62 … … 112 111 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 113 112 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 114 TurretPowerUp_sphereMat->select();115 // gluSphere(TurretPowerUp_sphereObj, 3, 5, 5);116 113 this->model->draw(); 114 115 this->sphereMaterial->select(); 116 this->sphereModel->draw(); 117 117 glPopMatrix(); 118 119 118 } 120 119 -
trunk/src/world_entities/power_ups/turret_power_up.h
r5435 r5437 27 27 Vector rotation; 28 28 float cycle; 29 30 Model* sphereModel; 31 Material* sphereMaterial; 29 32 }; 30 33
Note: See TracChangeset
for help on using the changeset viewer.