Showing the changes to interface/src/HandControl.cpp (1 of 6 files). Show all
Unified · Split
| @@ -33,14 +33,14 @@ HandControl::HandControl() { · 32 unmodified lines | ||
| 33 | 33 | _envelope = 0.0f; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | −void HandControl::setScreenDimensions( int width, int height ) { | |
| 36 | +void HandControl::setScreenDimensions(int width, int height) { | |
| 37 | 37 | _width = width; |
| 38 | 38 | _height = height; |
| 39 | 39 | _startX = _width / 2; |
| 40 | 40 | _startY = _height / 2; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | −void HandControl::update( int x, int y ) { | |
| 43 | +void HandControl::update(int x, int y) { | |
| 44 | 44 | _lastX = _x; |
| 45 | 45 | _lastY = _y; |
| 46 | 46 | _x = x; |
| @@ -49,22 +49,22 @@ void HandControl::update( int x, int y ) { · 2 unmodified lines | ||
| 49 | 49 | _velocityY = _y - _lastY; |
| 50 | 50 | |
| 51 | 51 | // if the mouse is moving, ramp up the envelope to increase amplitude of hand movement... |
| 52 | − if (( _velocityX != 0 ) | |
| 53 | − || ( _velocityY != 0 )) { | |
| 52 | + if ((_velocityX != 0) | |
| 53 | + || (_velocityY != 0)) { | |
| 54 | 54 | _enabled = true; |
| 55 | − if ( _envelope < 1.0 ) { | |
| 55 | + if (_envelope < 1.0) { | |
| 56 | 56 | _envelope += _rampUpRate; |
| 57 | − if ( _envelope >= 1.0 ) { | |
| 57 | + if (_envelope >= 1.0) { | |
| 58 | 58 | _envelope = 1.0; |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | // if not enabled ramp down the envelope to decrease amplitude of hand movement... |
| 64 | − if ( ! _enabled ) { | |
| 65 | − if ( _envelope > 0.0 ) { | |
| 64 | + if (! _enabled) { | |
| 65 | + if (_envelope > 0.0) { | |
| 66 | 66 | _envelope -= _rampDownRate; |
| 67 | − if ( _envelope <= 0.0 ) { | |
| 67 | + if (_envelope <= 0.0) { | |
| 68 | 68 | _startX = _width / 2; |
| 69 | 69 | _startY = _height / 2; |
| 70 | 70 | _envelope = 0.0; |
| @@ -77,14 +77,14 @@ void HandControl::update( int x, int y ) { · 6 unmodified lines | ||
| 77 | 77 | _backFront = 0.0; |
| 78 | 78 | |
| 79 | 79 | // if envelope is greater than zero, apply mouse movement to values to be output |
| 80 | − if ( _envelope > 0.0 ) { | |
| 81 | − _leftRight += ( ( _x - _startX ) / (float)_width ) * _envelope; | |
| 82 | − _downUp += ( ( _y - _startY ) / (float)_height ) * _envelope; | |
| 80 | + if (_envelope > 0.0) { | |
| 81 | + _leftRight += ((_x - _startX) / (float)_width ) * _envelope; | |
| 82 | + _downUp += ((_y - _startY) / (float)_height) * _envelope; | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | glm::vec3 HandControl::getValues() { |
| 87 | − return glm::vec3( _leftRight, _downUp, _backFront ); | |
| 87 | + return glm::vec3(_leftRight, _downUp, _backFront); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | void HandControl::stop() { |