wgpu backend: match GL pitch sign so drag-down tilts the camera up

Drag-down was decreasing pitch (camera diving), opposite to the GL
viewport's convention where drag-down increases pitch so the top of
the object rotates toward the viewer. Yaw direction was already
correct. Matches the existing user muscle memory from IfcViewerMinimal.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Dion Moult
2026-05-27 14:29:04 +10:00
parent de44de26f8
commit a95437dd64
+6 -3
View File
@@ -1485,9 +1485,12 @@ void WgpuViewportWindow::mouseMoveEvent(QMouseEvent* event) {
nav_last_pos_ = pos;
if (nav_active_button_ == Qt::LeftButton) {
// Orbit. 0.4 deg/px feels right for a 1280-wide window.
camera_yaw_deg_ += float(dx) * -0.4f;
camera_pitch_deg_ += float(dy) * -0.4f;
// Orbit. Sign convention matches the GL viewport: drag-right rotates
// the world right (yaw -= dx), drag-down tilts the camera up so we
// see more of the object's top (pitch += dy). 0.4 deg/px feels right
// for a 1280-wide window.
camera_yaw_deg_ -= float(dx) * 0.4f;
camera_pitch_deg_ += float(dy) * 0.4f;
camera_pitch_deg_ = std::clamp(camera_pitch_deg_, -89.9f, 89.9f);
requestUpdate();
} else if (nav_active_button_ == Qt::MiddleButton) {