diff --git a/modules/touch/include/touchinteraction.h b/modules/touch/include/touchinteraction.h index b2f09debc1..5709c3527c 100644 --- a/modules/touch/include/touchinteraction.h +++ b/modules/touch/include/touchinteraction.h @@ -172,6 +172,7 @@ private: properties::FloatProperty _rollAngleThreshold; properties::FloatProperty _orbitSpeedThreshold; properties::FloatProperty _spinSensitivity; + properties::FloatProperty _zoomSensitivity; properties::FloatProperty _inputStillThreshold; properties::FloatProperty _centroidStillThreshold; properties::FloatProperty _interpretPan; diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index 59b3d9688e..c554c2fcd4 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -142,6 +142,12 @@ namespace { "" // @TODO Missing documentation }; + static const openspace::properties::Property::PropertyInfo ZoomSensitivityInfo = { + "ZoomSensitivity", + "Sensitivity of exponential zooming in relation to distance from focus node", + "" // @TODO Missing documentation + }; + static const openspace::properties::Property::PropertyInfo InputSensitivityInfo = { "InputSensitivity", "Threshold for interpreting input as still", @@ -203,6 +209,7 @@ TouchInteraction::TouchInteraction() , _rollAngleThreshold(RollThresholdInfo, 0.025f, 0.f, 0.05f) , _orbitSpeedThreshold(OrbitSpinningThreshold, 0.005f, 0.f, 0.01f) , _spinSensitivity(SpinningSensitivityInfo, 1.f, 0.f, 2.f) + , _zoomSensitivity(ZoomSensitivityInfo, 1.04f, 1.0f, 1.1f) , _inputStillThreshold(InputSensitivityInfo, 0.0005f, 0.f, 0.001f) // used to void wrongly interpreted roll interactions , _centroidStillThreshold(StationaryCentroidInfo, 0.0018f, 0.f, 0.01f) @@ -260,6 +267,7 @@ TouchInteraction::TouchInteraction() addProperty(_rollAngleThreshold); addProperty(_orbitSpeedThreshold); addProperty(_spinSensitivity); + addProperty(_zoomSensitivity); addProperty(_inputStillThreshold); addProperty(_centroidStillThreshold); addProperty(_interpretPan); @@ -947,8 +955,8 @@ void TouchInteraction::computeVelocities(const std::vector& list, ) / lastProcessed.size(); double zoomFactor = (distance - lastDistance) * - (glm::distance(_camera->positionVec3(), _camera->focusPositionVec3()) - - _focusNode->boundingSphere()); + pow((glm::distance(_camera->positionVec3(), _camera->focusPositionVec3()) - + _focusNode->boundingSphere()), (float)_zoomSensitivity); _vel.zoom += zoomFactor * _sensitivity.zoom * std::max(_touchScreenSize.value() * 0.1, 1.0); break; @@ -1257,6 +1265,7 @@ void TouchInteraction::resetToDefault() { _rollAngleThreshold.set(0.025f); _orbitSpeedThreshold.set(0.005f); _spinSensitivity.set(1.0f); + _zoomSensitivity.set(10.f); _inputStillThreshold.set(0.0005f); _centroidStillThreshold.set(0.0018f); _interpretPan.set(0.015f);