Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6814 in orxonox.OLD


Ignore:
Timestamp:
Jan 28, 2006, 5:06:25 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: hover is as it should be… mucgh too fast :)

File:
1 edited

Legend:

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

    r6813 r6814  
    265265  float rotVal = .3;
    266266
    267   if( this->bForward ) {
     267  if( this->bForward )
     268  {
    268269    accel += Vector(rotVal, 0, 0);
    269270  }
    270271
    271   if( this->bBackward ) {
     272  if( this->bBackward )
     273  {
    272274    accel -= Vector(rotVal,0,0);
    273275  }
    274   if( this->bLeft) {
     276  if( this->bLeft)
     277  {
    275278    accel -= Vector(0,0,rotVal);
    276279  }
    277280
    278   if( this->bRight) {
     281  if( this->bRight)
     282  {
    279283    accel += Vector(0,0,rotVal);
    280284  }
    281285
    282   if (this->bAscend ) {
     286  if (this->bAscend )
     287  {
    283288    accel += Vector(0,rotVal,0);
    284289  }
    285   if (this->bDescend ) {
    286        accel -= Vector(0,rotVal,0);
    287   }
    288 
    289   velocity += accel * 30.0;
     290  if (this->bDescend )
     291  {
     292    accel -= Vector(0,rotVal,0);
     293  }
     294
     295  Vector tmp = this->getAbsDir().apply(accel * 30.0);
     296  tmp.y = accel.y;
     297  velocity += tmp;
     298
    290299
    291300  this->setRelDirSoft(this->direction * Quaternion(-accel.x, Vector(0,0,1)) * Quaternion(accel.z, Vector(1,0,0)), 5);
Note: See TracChangeset for help on using the changeset viewer.