Changeset 6999 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Feb 3, 2006, 1:03:41 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r6965 r6999 175 175 Vector up = this->getAbsDirV(); 176 176 Vector delay = Vector(0, 0, 0); 177 if( currentMode != VIEW_FRONT) delay = (this->target->getVelocity()) / 25.0f;177 //if( currentMode != VIEW_FRONT) delay = (this->target->getVelocity()) / 25.0f; 178 178 179 179 // Setting the Camera Eye, lookAt and up Vectors -
trunk/src/world_entities/camera.h
r6139 r6999 58 58 float toFovy; //!< The fovy-mode to iterate to. 59 59 ViewMode currentMode; //!< The ViewMode the camera is in 60 61 Vector delay; 60 62 }; 61 63 -
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 -
trunk/src/world_entities/space_ships/hover.h
r6871 r6999 60 60 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 61 61 float acceleration; //!< the acceleration of the Hover. 62 float airFriction; //!< AirFriction. 62 63 63 64 float rotorSpeed; //!< the speed of the rotor.
Note: See TracChangeset
for help on using the changeset viewer.