Skip to content

Commit 0ae38c4

Browse files
authored
Merge pull request #2167 from Kitware/webvr_fix_controller_movement
fix(WebVR): controller movement was off for scales far from 1
2 parents 129f4bf + f5b41e4 commit 0ae38c4

File tree

2 files changed

+2
-2
lines changed
  • Sources/Interaction
    • Manipulators/VRButtonPanManipulator
    • Style/InteractorStyleTrackballCamera

2 files changed

+2
-2
lines changed

Sources/Interaction/Manipulators/VRButtonPanManipulator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function vtkVRButtonPanManipulator(publicAPI, model) {
4343
const speed = data.gamepad.axes[1];
4444

4545
// 0.05 meters / frame movement
46-
const pscale = (speed * 0.05) / camera.getPhysicalScale();
46+
const pscale = speed * 0.05 * camera.getPhysicalScale();
4747

4848
// convert orientation to world coordinate direction
4949
const dir = camera.physicalOrientationToWorldDirection(data.orientation);

Sources/Interaction/Style/InteractorStyleTrackballCamera/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function vtkInteractorStyleTrackballCamera(publicAPI, model) {
9494
const speed = ed.gamepad.axes[1];
9595

9696
// 0.05 meters / frame movement
97-
const pscale = (speed * 0.05) / camera.getPhysicalScale();
97+
const pscale = speed * 0.05 * camera.getPhysicalScale();
9898

9999
// convert orientation to world coordinate direction
100100
const dir = camera.physicalOrientationToWorldDirection(ed.orientation);

0 commit comments

Comments
 (0)