Android view control sensitivity increased. Constant replaced for a private value member.

This commit is contained in:
Cristian Luis Duarte 2018-03-15 17:10:14 -03:00
parent 379fa9783f
commit f8f5655561
2 changed files with 6 additions and 6 deletions

View file

@ -135,12 +135,12 @@ void TouchscreenVirtualPadDevice::processInputDeviceForView() {
rightDistanceScaleX = (_viewCurrentTouchPoint.x - _viewRefTouchPoint.x) / _screenDPIScale.x;
rightDistanceScaleY = (_viewCurrentTouchPoint.y - _viewRefTouchPoint.y) / _screenDPIScale.y;
rightDistanceScaleX = clip(rightDistanceScaleX, -STICK_RADIUS_INCHES, STICK_RADIUS_INCHES);
rightDistanceScaleY = clip(rightDistanceScaleY, -STICK_RADIUS_INCHES, STICK_RADIUS_INCHES);
rightDistanceScaleX = clip(rightDistanceScaleX, -_viewStickRadiusInches, _viewStickRadiusInches);
rightDistanceScaleY = clip(rightDistanceScaleY, -_viewStickRadiusInches, _viewStickRadiusInches);
// NOW BETWEEN -1 1
rightDistanceScaleX /= STICK_RADIUS_INCHES;
rightDistanceScaleY /= STICK_RADIUS_INCHES;
rightDistanceScaleX /= _viewStickRadiusInches;
rightDistanceScaleY /= _viewStickRadiusInches;
_inputDevice->_axisStateMap[controller::RX] = rightDistanceScaleX;
_inputDevice->_axisStateMap[controller::RY] = rightDistanceScaleY;

View file

@ -20,8 +20,6 @@
class QTouchEvent;
class QGestureEvent;
const float STICK_RADIUS_INCHES = .3f;
class TouchscreenVirtualPadDevice : public InputPlugin {
Q_OBJECT
public:
@ -96,6 +94,8 @@ protected:
float _fixedRadiusForCalc;
int _extraBottomMargin {0};
float _viewStickRadiusInches {0.17495f}; // agreed default
void moveTouchBegin(glm::vec2 touchPoint);
void moveTouchUpdate(glm::vec2 touchPoint);
void moveTouchEnd();