Changeset 7146 in orxonox.OLD for branches/control/src/world_entities/space_ships/space_ship.cc
- Timestamp:
- Feb 14, 2006, 8:04:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/control/src/world_entities/space_ships/space_ship.cc
r7141 r7146 339 339 { 340 340 Playable::tick(time); 341 342 if( ( xMouse != 0 341 342 if( ( xMouse != 0 343 343 || yMouse != 0 ) 344 344 && this->getOwner() == this->getHostID() ) 345 345 { 346 346 if (xMouse > controlVelocityX) xMouse = controlVelocityX; … … 351 351 pitchDir = (Quaternion(xMouse*mouseSensitivity*0.5, Vector(1,0,0))); 352 352 353 if( fabsf(mouseDir.distance(this->getAbsDir())) < maxRudderAmplitude )//prevent 'jumping' 354 { 355 356 mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir); 357 } 353 Quaternion correctionQuat = (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir); 354 if( fabsf((mouseDir*correctionQuat).distance(this->getAbsDir())) < maxRudderAmplitude )//prevent 'jumping' 355 { 356 mouseDir *= correctionQuat; 357 } 358 else 359 { 360 mouseDir = quatSlerp(mouseDir,mouseDir*correctionQuat,fabsf(time)); 361 } 358 362 xMouse = yMouse = 0; 359 363 } 360 364 361 365 362 366 363 367 // if( this != State::getPlayer()->getControllable())
Note: See TracChangeset
for help on using the changeset viewer.