Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 19, 2006, 1:17:46 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: extreme cleanup in Playable

File:
1 edited

Legend:

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

    r7345 r7346  
    103103  this->setClassID(CL_TURBINE_HOVER, "TurbineHover");
    104104
    105   this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal);
     105  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical);
    106106
    107107  this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3);
     
    393393      }
    394394      break;
     395
     396    case Playable::Vertical:
     397    {
     398      accel.z = 0;
     399      Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
     400      accelerationDir.z=0;
     401
     402        // this is the air friction (necessary for a smooth control)
     403      Vector damping = (this->velocity * this->airFriction);
     404
     405      this->velocity += (accelerationDir - damping)* dt;
     406      this->shiftCoor (this->velocity * dt);
     407
     408      this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
     409
     410      this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     411      this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);
     412
     413      this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     414      this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);
     415    }
     416    break;
    395417  }
    396418}
Note: See TracChangeset for help on using the changeset viewer.