Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

space_ship.cc updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)));
Note: See TracChangeset for help on using the changeset viewer.