Changeset 6699 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/space_ships/hover.cc
- Timestamp:
- Jan 25, 2006, 3:09:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/space_ships/hover.cc
r6637 r6699 110 110 PRINTF(4)("HOVER INIT\n"); 111 111 112 this->loadModel("models/ships/ fighter.obj", 1.0);112 this->loadModel("models/ships/nimrod_#.obj", 1.0); 113 113 114 114 EventHandler::getInstance()->grabEvents(true); … … 118 118 xMouse = yMouse = 0; 119 119 mouseSensitivity = 0.05; 120 controlVelocityX = 100; 121 controlVelocityY = 100; 120 122 121 123 … … 241 243 void Hover::tick (float time) 242 244 { 243 244 245 if( xMouse != 0 || yMouse != 0) 246 { 247 if (xMouse > controlVelocityX) xMouse = controlVelocityX; 248 else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX; 249 if (yMouse > controlVelocityY) yMouse = controlVelocityY; 250 else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY; 251 } 252 245 253 Quaternion xDir = Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0)); 246 254 Quaternion yDir = Quaternion(-M_PI/4*yMouse*mouseSensitivity, Vector(0,0,1)); … … 261 269 else this->shiftDir(xDir*yDir); 262 270 263 if((this->getAbsDirZ()).y > 0.1) this->shiftDir(Quaternion(0.01,Vector(1,0,0))); 264 else if((this->getAbsDirZ()).y < -0.1) this->shiftDir(Quaternion(-0.01,Vector(1,0,0))); 265 271 if((this->getAbsDirZ()).y > 0.05) this->shiftDir(Quaternion(0.02,Vector(1,0,0))); 272 else if((this->getAbsDirZ()).y < -0.05) this->shiftDir(Quaternion(-0.02,Vector(1,0,0))); 266 273 267 274 // spaceship controlled movement
Note: See TracChangeset
for help on using the changeset viewer.