Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mouse for camera controller #2566

Open
wants to merge 1 commit into
base: dev/qt6.6
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions meshroom/ui/qml/Viewer3D/DefaultCameraController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Entity {
property real translateSpeed: 75.0
property real tiltSpeed: 500.0
property real panSpeed: 500.0
readonly property bool moving: actionLMB.active
readonly property bool panning: (keyboardHandler._pressed && actionLMB.active && actionShift.active) || actionMMB.active
readonly property bool zooming: keyboardHandler._pressed && actionRMB.active && actionAlt.active
property alias focus: keyboardHandler.focus
readonly property bool pickingActive: actionControl.active && keyboardHandler._pressed
property alias rotationSpeed: trackball.rotationSpeed
Expand Down Expand Up @@ -68,7 +65,12 @@ Entity {
const dt = 0.02
var d

if (panning) { // Translate
var moving = mouse.buttons & Qt.LeftButton
var panning = (mouse.buttons & Qt.MiddleButton)
var panningAlt = actionShift.active && (mouse.buttons & Qt.LeftButton)
var zooming = actionAlt.active && (mouse.buttons & Qt.RightButton)

if (panning || panningAlt) { // Translate
d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03
var tx = axisMX.value * root.translateSpeed * d
var ty = axisMY.value * root.translateSpeed * d
Expand Down
Loading