Changeset 6999 in orxonox.OLD for trunk/src/world_entities/space_ships/hover.cc
- Timestamp:
- Feb 3, 2006, 1:03:41 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/hover.cc
r6998 r6999 112 112 this->cameraLook = 0.0f; 113 113 this->rotation = 0.0f; 114 this->acceleration = 1.0; 114 this->acceleration = 25.0f; 115 this->airFriction = 3.0f; 115 116 116 117 // camera - issue … … 278 279 accel -= Vector(0, this->acceleration, 0); 279 280 } 280 Vector tmp = this->getAbsDir().apply(accel * 200.0); 281 //tmp.y = accel.y * 500.0 ; 282 velocity += tmp * dt; 283 284 accel -= this->getAbsDir().inverse().apply(velocity * .005); 281 282 Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration); 285 283 286 284 // this is the air friction (necessary for a smooth control) 287 this->velocity *= 0.99; 288 this->shiftCoor (velocity * dt); 285 Vector damping = (this->velocity * this->airFriction); 286 287 288 this->velocity += (accelerationDir - damping)* dt; 289 290 this->shiftCoor (this->velocity * dt); 289 291 this->rotation = 0.0f; 290 292 291 293 this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5); 292 294 293 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z +this->rotation, Vector(1,0,0)), 5);294 this->rotorNodeLeft.setRelDirSoft(Quaternion(- 2.0*accel.x+this->rotation + cameraLook, Vector(0,0,1)), 5);295 296 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z +this->rotation, Vector(1,0,0)), 5);297 this->rotorNodeRight.setRelDirSoft(Quaternion(- 2.0*accel.x-this->rotation + cameraLook, Vector(0,0,1)), 5);295 this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .03 +this->rotation, Vector(1,0,0)), 5); 296 this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .05+this->rotation + cameraLook, Vector(0,0,1)), 5); 297 298 this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .03 +this->rotation, Vector(1,0,0)), 5); 299 this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.05 -this->rotation + cameraLook, Vector(0,0,1)), 5); 298 300 } 299 301
Note: See TracChangeset
for help on using the changeset viewer.