Changeset 7859
- Timestamp:
- Feb 12, 2011, 11:34:40 AM (14 years ago)
- Location:
- code/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/input/HalfAxis.h
r5781 r7859 58 58 bool addParamCommand(ParamCommand* command); 59 59 void clear(); 60 void reset(); 60 61 61 62 // axis related … … 77 78 return success; 78 79 } 80 81 inline void HalfAxis::reset() 82 { 83 this->relVal_ = 0.0f; 84 this->absVal_ = 0.0f; 85 this->hasChanged_ = true; 86 } 79 87 } 80 88 -
code/trunk/src/libraries/core/input/KeyBinder.cc
r7401 r7859 388 388 { 389 389 for (unsigned int iDev = 0; iDev < joySticks_.size(); ++iDev) 390 {391 390 for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++) 392 { 393 (*joyStickAxes_[iDev])[i].absVal_ = 0.0f; 394 (*joyStickAxes_[iDev])[i].relVal_ = 0.0f; 395 } 396 } 391 (*joyStickAxes_[iDev])[i].reset(); 392 } 393 394 /** 395 @brief Sets the position of the mouse back to 0/0. 396 */ 397 void KeyBinder::resetMouseAxes() 398 { 399 this->mousePosition_[0] = 0.0f; 400 this->mousePosition_[1] = 0.0f; 401 402 for (unsigned int i = 0; i < MouseAxisCode::numberOfAxes * 2; i++) 403 mouseAxes_[i].reset(); 397 404 } 398 405 -
code/trunk/src/libraries/core/input/KeyBinder.h
r6536 r7859 74 74 void setConfigValues(); 75 75 void resetJoyStickAxes(); 76 void resetMouseAxes(); 76 77 77 78 protected: // functions -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r7801 r7859 38 38 #include "core/CoreIncludes.h" 39 39 #include "core/command/ConsoleCommand.h" 40 #include "core/input/KeyBinder.h" 41 #include "core/input/KeyBinderManager.h" 40 42 #include "worldentities/ControllableEntity.h" 41 43 #include "worldentities/pawns/Pawn.h" … … 347 349 this->firemode_ = -1; 348 350 hideArrows(); 351 } 352 353 void NewHumanController::centerCursor() 354 { 355 this->currentYaw_ = 0; 356 this->currentPitch_ = 0; 357 358 KeyBinderManager::getInstance().getCurrent()->resetMouseAxes(); 349 359 } 350 360 … … 481 491 { 482 492 this->controlMode_ = 0; 483 this->currentYaw_ = 0; 484 this->currentPitch_ = 0; 493 this->centerCursor(); 485 494 if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket")))) 486 495 { -
code/trunk/src/orxonox/controllers/NewHumanController.h
r7163 r7859 61 61 virtual void doUnfire(); 62 62 63 void centerCursor(); 64 63 65 static void changeMode(); 64 66
Note: See TracChangeset
for help on using the changeset viewer.