Changeset 6155 for code/branches/presentation2/src/libraries
- Timestamp:
- Nov 25, 2009, 8:02:22 PM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries/core/input
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/input/KeyBinder.cc
r5929 r6155 50 50 mouseRelative_[0] = 0; 51 51 mouseRelative_[1] = 0; 52 mousePosition_[0] = 0 ;53 mousePosition_[1] = 0 ;52 mousePosition_[0] = 0.0; 53 mousePosition_[1] = 0.0; 54 54 55 55 RegisterRootObject(KeyBinder); … … 128 128 SetConfigValue(mouseSensitivity_, 1.0f) 129 129 .description("Mouse sensitivity."); 130 this->totalMouseSensitivity_ = this->mouseSensitivity_ / this->mouseClippingSize_; 130 131 SetConfigValue(bDeriveMouseInput_, false) 131 132 .description("Whether or not to derive moues movement for the absolute value."); … … 426 427 mouseAxes_[2*i + 0].hasChanged_ = true; 427 428 mouseAxes_[2*i + 1].hasChanged_ = true; 428 mousePosition_[i] += rel[i] ;429 mousePosition_[i] += rel[i] * totalMouseSensitivity_; 429 430 430 431 // clip absolute position 431 if (mousePosition_[i] > mouseClippingSize_)432 mousePosition_[i] = mouseClippingSize_;433 if (mousePosition_[i] < - mouseClippingSize_)434 mousePosition_[i] = - mouseClippingSize_;435 436 if (mousePosition_[i] < 0 )432 if (mousePosition_[i] > 1.0) 433 mousePosition_[i] = 1.0; 434 if (mousePosition_[i] < -1.0) 435 mousePosition_[i] = -1.0; 436 437 if (mousePosition_[i] < 0.0) 437 438 { 438 mouseAxes_[2*i + 0].absVal_ = -mouse Sensitivity_ * mousePosition_[i] / mouseClippingSize_;439 mouseAxes_[2*i + 0].absVal_ = -mousePosition_[i]; 439 440 mouseAxes_[2*i + 1].absVal_ = 0.0f; 440 441 } … … 442 443 { 443 444 mouseAxes_[2*i + 0].absVal_ = 0.0f; 444 mouseAxes_[2*i + 1].absVal_ = mouse Sensitivity_ * mousePosition_[i] / mouseClippingSize_;445 mouseAxes_[2*i + 1].absVal_ = mousePosition_[i]; 445 446 } 446 447 } … … 452 453 { 453 454 if (rel[i] < 0) 454 mouseAxes_[0 + 2*i].relVal_ = - mouseSensitivity_ * rel[i] / mouseClippingSize_;455 mouseAxes_[0 + 2*i].relVal_ = -rel[i] * totalMouseSensitivity_; 455 456 else 456 mouseAxes_[1 + 2*i].relVal_ = mouseSensitivity_ * rel[i] / mouseClippingSize_;457 mouseAxes_[1 + 2*i].relVal_ = rel[i] * totalMouseSensitivity_; 457 458 } 458 459 } -
code/branches/presentation2/src/libraries/core/input/KeyBinder.h
r5929 r6155 138 138 std::vector<BufferedParamCommand*> paramCommandBuffer_; 139 139 140 //! Keeps track of the absolute mouse value (incl. scroll wheel)141 int mousePosition_[2];140 //! Keeps track of the absolute mouse value 141 float mousePosition_[2]; 142 142 //! Used to derive mouse input if requested 143 143 int mouseRelative_[2]; … … 165 165 //! mouse sensitivity if mouse input is derived 166 166 float mouseSensitivityDerived_; 167 //! Equals one step of the mouse wheel167 //! Equals one step of the mouse wheel 168 168 int mouseWheelStepSize_; 169 170 //! Multiplication of mouse sensitivity and clipping size 171 float totalMouseSensitivity_; 169 172 170 173 //##### Constant config variables #####
Note: See TracChangeset
for help on using the changeset viewer.