Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7346 in orxonox.OLD for trunk/src/world_entities/space_ships


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

orxonox/trunk: extreme cleanup in Playable

Location:
trunk/src/world_entities/space_ships
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/helicopter.h

    r7337 r7346  
    2222
    2323    virtual void loadParams(const TiXmlElement* root);
    24     virtual void setStartDirection(const Quaternion& rot){/* FIXME */};
     24    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */};
    2525
    2626    virtual void enter();
  • trunk/src/world_entities/space_ships/hover.h

    r7337 r7346  
    1919
    2020    virtual void loadParams(const TiXmlElement* root);
    21     virtual void setStartDirection(const Quaternion& rot) {/* FIXME */};
     21    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */};
    2222
    2323    virtual void enter();
  • trunk/src/world_entities/space_ships/space_ship.cc

    r7337 r7346  
    248248}
    249249
    250 void SpaceShip::setStartDirection(const Quaternion& quat)
     250void SpaceShip::setPlayDirection(const Quaternion& quat, float speed)
    251251{
    252252  this->mouseDir = quat;
  • trunk/src/world_entities/space_ships/space_ship.h

    r7337 r7346  
    2727    virtual void loadParams(const TiXmlElement* root);
    2828
    29     virtual void setStartDirection(const Quaternion& rot);
     29    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
    3030
    3131    virtual void enter();
  • 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}
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r7339 r7346  
    2222
    2323    virtual void loadParams(const TiXmlElement* root);
    24     virtual void setStartDirection(const Quaternion& rot) {/* FIXME */};
     24    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f) {/* FIXME */};
    2525    virtual void enter();
    2626    virtual void leave();
Note: See TracChangeset for help on using the changeset viewer.