-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoom_adjust.patch
35 lines (32 loc) · 1.28 KB
/
zoom_adjust.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git src/interaction/mousecamerastates.cpp src/interaction/mousecamerastates.cpp
index 71f3265c4..fb4f0076b 100644
--- src/interaction/mousecamerastates.cpp
+++ src/interaction/mousecamerastates.cpp
@@ -26,6 +26,11 @@
#include <openspace/interaction/inputstate.h>
+namespace {
+ const double SENSITIVITY_ADJUSTMENT_INCREASE = 8.0;
+ const double SENSITIVITY_ADJUSTMENT_DECREASE = 0.5;
+}
+
namespace openspace::interaction {
MouseCameraStates::MouseCameraStates(double sensitivity, double velocityScaleFactor)
@@ -82,8 +87,17 @@ void MouseCameraStates::updateStateFromInput(const InputState& inputState,
if (button2Pressed || (keyAltPressed && button1Pressed)) {
glm::dvec2 mousePositionDelta = _truckMovementState.previousPosition -
mousePosition;
+
+ double sensitivityAdjustment = 1.0;
+ if (keyCtrlPressed) {
+ sensitivityAdjustment = SENSITIVITY_ADJUSTMENT_INCREASE;
+ }
+ else if (keyShiftPressed) {
+ sensitivityAdjustment = SENSITIVITY_ADJUSTMENT_DECREASE;
+ }
+
_truckMovementState.velocity.set(
- mousePositionDelta * _sensitivity,
+ mousePositionDelta * _sensitivity * sensitivityAdjustment,
deltaTime
);
}