Changeset 7346 in orxonox.OLD for trunk/src/world_entities/space_ships/turbine_hover.cc
- Timestamp:
- Apr 19, 2006, 1:17:46 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/turbine_hover.cc
r7345 r7346 103 103 this->setClassID(CL_TURBINE_HOVER, "TurbineHover"); 104 104 105 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal );105 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); 106 106 107 107 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); … … 393 393 } 394 394 break; 395 396 case Playable::Vertical: 397 { 398 accel.z = 0; 399 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration); 400 accelerationDir.z=0; 401 402 // this is the air friction (necessary for a smooth control) 403 Vector damping = (this->velocity * this->airFriction); 404 405 this->velocity += (accelerationDir - damping)* dt; 406 this->shiftCoor (this->velocity * dt); 407 408 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 409 410 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 411 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5); 412 413 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5); 414 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5); 415 } 416 break; 395 417 } 396 418 }
Note: See TracChangeset
for help on using the changeset viewer.