Changeset 5000 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons
- Timestamp:
- Aug 13, 2005, 9:07:56 PM (19 years ago)
- Location:
- orxonox/trunk/src/world_entities/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/weapons/test_gun.cc
r4982 r5000 178 178 179 179 pj->setParent(NullParent::getInstance()); 180 /* 181 PNode* target = this->getWeaponManager()->getFixedTarget(); 182 if (target != NULL) 183 { 184 pj->setVelocity(this->getVelocity()+(target->getAbsCoor() - this->getAbsCoor())*.5);//this->getVelocity()); 185 } 186 else*/ 180 187 181 pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*20); 188 182 … … 219 213 void TestGun::draw () 220 214 { 221 this->getWeaponManager()->getFixedTarget()->debugDraw(10);222 223 215 /* draw gun body */ 224 216 glMatrixMode(GL_MODELVIEW); 225 217 glPushMatrix(); 226 float matrix[4][4];227 218 glTranslatef (this->getAbsCoor ().x, 228 219 this->getAbsCoor ().y, 229 220 this->getAbsCoor ().z); 230 this->getAbsDir ().matrix (matrix); 231 glMultMatrixf((float*)matrix); 221 222 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 223 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 224 232 225 if( this->leftRight == W_RIGHT) 233 226 glScalef(1.0, 1.0, -1.0); … … 241 234 this->objectComponent1->getAbsCoor ().y, 242 235 this->objectComponent1->getAbsCoor ().z); 243 t his->objectComponent1->getAbsDir ().matrix (matrix);244 gl MultMatrixf((float*)matrix);236 tmpRot = this->objectComponent1->getAbsDir().getSpacialAxis(); 237 glRotatef (this->objectComponent1->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 245 238 this->model->draw(0); 246 239 glPopMatrix(); -
orxonox/trunk/src/world_entities/weapons/turret.cc
r4982 r5000 164 164 glMatrixMode(GL_MODELVIEW); 165 165 glPushMatrix(); 166 float matrix[4][4];167 166 glTranslatef (this->getAbsCoor ().x, 168 167 this->getAbsCoor ().y, 169 168 this->getAbsCoor ().z); 170 this->getAbsDir ().matrix (matrix);171 gl MultMatrixf((float*)matrix);169 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 170 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 172 171 173 172 this->model->draw();
Note: See TracChangeset
for help on using the changeset viewer.