Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 21, 2005, 3:36:25 PM (19 years ago)
Author:
bensch
Message:

trunk: merged the spaceshipcontrol back to the trunk

File:
1 edited

Legend:

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

    r6222 r6241  
    112112  PRINTF(4)("SPACESHIP INIT\n");
    113113
    114 //   EventHandler::getInstance()->grabEvents(true);
     114  EventHandler::getInstance()->grabEvents(true);
    115115
    116116  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
     
    193193{
    194194  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     195  this->attachCamera();
    195196
    196197
     
    200201{
    201202  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     203  this->detachCamera();
    202204
    203205
     
    284286
    285287  //orient the spaceship in direction of the mouse
    286    rotQuat = Quaternion::quatSlerp( this->getAbsDir(),mouseDir,fabsf(time)*3);
    287    if (this->getAbsDir().distance(rotQuat) > 0.001)
     288   rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*3.0);
     289   if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
    288290    this->setAbsDir( rotQuat);
    289291   //this->setAbsDirSoft(mouseDir,5);
     
    440442    this->yMouse = event.yRel;
    441443    mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)));
    442     if( xMouse*xMouse + yMouse*yMouse < 0.9)
    443      this->setAbsDir(mouseDir);
     444   // if( xMouse*xMouse + yMouse*yMouse < 0.9)
     445     //this->setAbsDir(mouseDir);
    444446  }
    445447}
Note: See TracChangeset for help on using the changeset viewer.