- Timestamp:
- Nov 27, 2015, 1:41:26 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc
r10871 r10875 29 29 #include "core/XMLPort.h" 30 30 #include "worldentities/pawns/SpaceShip.h" 31 #include "util/Math.h" 31 32 32 33 namespace orxonox … … 128 129 void FlyingController::copyOrientation( const Quaternion& orient, float dt ) 129 130 { 130 //roll angle difference in radian 131 floatdiff=orient.getRoll(false).valueRadians() -131 132 double diff=orient.getRoll(false).valueRadians() - 132 133 ( this->getControllableEntity() ->getOrientation() .getRoll( false ).valueRadians() ); 133 while( diff>math::twoPi 134 while( diff>math::twoPi)diff-=math::twoPi; 134 135 while( diff<-math::twoPi )diff+=math::twoPi; 135 this->getControllableEntity() ->rotateRoll( diff*0.2f*ROTATEFACTOR * dt ); 136 137 this->getControllableEntity() ->rotateRoll(diff * ROTATEFACTOR * dt); 136 138 } 139 //change log: increased precision, increased rotation speed 137 140 void FlyingController::copyTargetOrientation( float dt ) 138 141 {
Note: See TracChangeset
for help on using the changeset viewer.