Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6544 in orxonox.OLD for branches/spaceshipcontrol


Ignore:
Timestamp:
Jan 18, 2006, 2:10:57 PM (19 years ago)
Author:
snellen
Message:

space_ship.cc updated

Location:
branches/spaceshipcontrol/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/spaceshipcontrol/src/world_entities/projectiles/guided_missile.cc

    r6434 r6544  
    4444  this->setMaxEnergy(10);
    4545  this->lifeSpan = 10.0;
    46   this->agility = 500;
     46  this->agility = 5;
    4747  this->maxVelocity = 75;
    4848
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc

    r6537 r6544  
    130130  mouseSensitivity = 0.001;
    131131  airViscosity = 0.95;
     132  controlVelocityX = 5;
     133  controlVelocityY = 150;
     134  shipInertia = 3.0             ;
    132135//  cycle = 0.0;
    133136
     
    285288
    286289  //orient the spaceship in direction of the mouse
    287    rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*3.0);
     290   rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*shipInertia);
    288291   if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
    289292    this->setAbsDir( rotQuat);
     
    299302  if((this->getAbsDirY()).y*travelSpeed < 120 && (this->getAbsDirY()).y<0)
    300303  move += Vector(0,-1,0)*60*time - Vector(0,1,0)*(this->getAbsDirY()).y*travelSpeed/2*time;
    301 
     304   
    302305  //hoover effect
    303306  //cycle += time;
     
    448451    this->yMouse = event.yRel;
    449452   
    450     int controlVelocity = 150;
    451453   
    452     if (xMouse > controlVelocity) xMouse = controlVelocity;
    453     else if (xMouse < -controlVelocity) xMouse = -controlVelocity;
    454     if (yMouse > controlVelocity) yMouse = controlVelocity;
    455     else if (yMouse < -controlVelocity) yMouse = -controlVelocity;
     454   
     455    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
     456    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
     457    if (yMouse > controlVelocityY) yMouse = controlVelocityY;
     458    else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY;
    456459   
    457460    //pitchDir *= (Quaternion(xMouse*mouseSensitivity*0.01, Vector(1,0,0)));
  • branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.h

    r6509 r6544  
    6666    float                 yMouse;             //!< mouse moved in y-Direction
    6767    float                 mouseSensitivity;   //!< the mouse sensitivity
     68    int                   controlVelocityX;
     69    int                   controlVelocityY;
    6870//    float                 cycle;              //!< hovercycle
    6971
    7072    Vector                velocity;           //!< the velocity of the player.
    7173    Quaternion            mouseDir;           //!< the direction where the player wants to fly
     74    float                 shipInertia;        //!< the inertia of the ship(how fast the ship reacts to a mouse input)
    7275    Quaternion            rotQuat;
    7376    Quaternion            pitchDir;
Note: See TracChangeset for help on using the changeset viewer.