Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7326 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Apr 17, 2006, 2:42:37 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: limiting the maximum rotation speed of the turbine_hover, as proposed by the network-guys

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/sound_source.cc

    r7318 r7326  
    253253  alSource3f(sourceID, AL_DIRECTION,       0.0, 0.0, 0.0);
    254254  alSourcef (sourceID, AL_ROLLOFF_FACTOR,  0.0          );
    255   alSourcei (sourceID, AL_SOURCE_RELATIVE, AL_TRUE      );
     255  //alSourcei (sourceID, AL_SOURCE_RELATIVE, AL_TRUE      );
    256256  alSourcef (sourceID, AL_GAIN,            SoundEngine::getInstance()->getEffectsVolume());
    257257}
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7221 r7326  
    331331
    332332  this->velocity += (accelerationDir - damping)* dt;
    333 
    334333  this->shiftCoor (this->velocity * dt);
    335   this->rotation = 0.0f;
     334
     335  // limit the maximum rotation speed.
     336  if (this->rotation != 0.0f)
     337  {
     338    float maxRot = 10.0 * dt;
     339    if (unlikely(this->rotation > maxRot)) this->rotation = maxRot;
     340    if (unlikely(this->rotation < -maxRot)) this->rotation = -maxRot;
     341    this->direction *= Quaternion(-M_PI/4.0*this->rotation, Vector(0,1,0));
     342
     343    this->rotation = 0.0f;
     344  }
    336345
    337346  this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
     
    421430
    422431    // rotate the Player around the y-axis
    423     this->direction *= Quaternion(-M_PI/4.0*xMouse, Vector(0,1,0));
    424432    this->rotation += xMouse;
    425433
Note: See TracChangeset for help on using the changeset viewer.