Changeset 5801 in orxonox.OLD for branches/world_entities/src/world_entities/weapons/turret.cc
- Timestamp:
- Nov 27, 2005, 7:10:01 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/world_entities/weapons/turret.cc
r5766 r5801 44 44 this->init(); 45 45 46 this->loadModel("models/guns/turret1.obj");47 48 49 46 this->setActionSound(WA_SHOOT, "sound/shot1.wav"); 50 47 this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav"); 51 48 this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav"); 49 50 this->loadModel("models/guns/turret1.obj"); 52 51 } 53 52 … … 72 71 { 73 72 this->setClassID(CL_TURRET, "Turret"); 73 74 74 75 75 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 138 138 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13) 139 139 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 140 140 141 141 142 142 pj->setParent(NullParent::getInstance()); … … 154 154 void Turret::draw () const 155 155 { 156 /* draw gun body */ 157 glMatrixMode(GL_MODELVIEW); 158 glPushMatrix(); 159 glTranslatef (this->getAbsCoor ().x, 160 this->getAbsCoor ().y, 161 this->getAbsCoor ().z); 162 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 163 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 156 if (this->model != NULL) 157 { 158 /* draw gun body */ 159 glMatrixMode(GL_MODELVIEW); 160 glPushMatrix(); 161 glTranslatef (this->getAbsCoor ().x, 162 this->getAbsCoor ().y, 163 this->getAbsCoor ().z); 164 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 165 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 164 166 165 this->model->draw(); 166 glPopMatrix(); 167 this->model->draw(); 168 glPopMatrix(); 169 } 167 170 } 168
Note: See TracChangeset
for help on using the changeset viewer.