Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7327 in orxonox.OLD


Ignore:
Timestamp:
Apr 17, 2006, 2:45:01 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: also in the Hover now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/hover.cc

    r7221 r7327  
    291291
    292292  this->shiftCoor (this->velocity * dt);
    293   this->rotation = 0.0f;
     293
     294    // limit the maximum rotation speed.
     295  if (this->rotation != 0.0f)
     296  {
     297    float maxRot = 10.0 * dt;
     298    if (unlikely(this->rotation > maxRot)) this->rotation = maxRot;
     299    if (unlikely(this->rotation < -maxRot)) this->rotation = -maxRot;
     300    this->direction *= Quaternion(-M_PI/4.0*this->rotation, Vector(0,1,0));
     301    this->rotation = 0.0f;
     302  }
    294303
    295304  this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
     
    381390
    382391    // rotate the Player around the y-axis
    383     this->direction *= Quaternion(-M_PI/4.0*xMouse, Vector(0,1,0));
    384392    this->rotation += xMouse;
    385393
Note: See TracChangeset for help on using the changeset viewer.