mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user