Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6999 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Feb 3, 2006, 1:03:41 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Hover should be Time Independant

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/camera.cc

    r6965 r6999  
    175175  Vector up = this->getAbsDirV();
    176176  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;
    178178
    179179   // Setting the Camera Eye, lookAt and up Vectors
  • trunk/src/world_entities/camera.h

    r6139 r6999  
    5858  float             toFovy;          //!< The fovy-mode to iterate to.
    5959  ViewMode          currentMode;     //!< The ViewMode the camera is in
     60
     61  Vector            delay;
    6062};
    6163
  • trunk/src/world_entities/space_ships/hover.cc

    r6998 r6999  
    112112  this->cameraLook = 0.0f;
    113113  this->rotation = 0.0f;
    114   this->acceleration = 1.0;
     114  this->acceleration = 25.0f;
     115  this->airFriction = 3.0f;
    115116
    116117  // camera - issue
     
    278279    accel -= Vector(0, this->acceleration, 0);
    279280  }
    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);
    285283
    286284  // 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);
    289291  this->rotation = 0.0f;
    290292
    291293  this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
    292294
    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);
    298300}
    299301
  • trunk/src/world_entities/space_ships/hover.h

    r6871 r6999  
    6060    float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
    6161    float                 acceleration;       //!< the acceleration of the Hover.
     62    float                 airFriction;        //!< AirFriction.
    6263
    6364    float                 rotorSpeed;         //!< the speed of the rotor.
Note: See TracChangeset for help on using the changeset viewer.