mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 08:04:57 +01:00
feat(editor): the wheel held and dragged pans the perspective view too, the ground under the cursor going along with it
Pressing the mouse wheel and dragging pans the top view; now it pans the perspective view as well. The camera moves over the ground, its height and its turn kept, by as much of the ground as the cursor crosses where it was pressed: metres to a pixel taken from the distance to what is under the cursor, and a pixel up the screen counted as more of the ground than one across as the camera looks down less steeply. With nothing under the cursor (the sky) it doesn't start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
@@ -225,6 +225,7 @@ class editor_mode : public application_mode, private editor_track::observer
|
||||
double m_ortho_pitch{0.0};
|
||||
bool m_ortho_pan{false};
|
||||
glm::dvec2 m_ortho_pan_cursor{0.0};
|
||||
double m_pan_metres{0.0}; // of the ground to a pixel, held by the panning in the perspective view
|
||||
void ortho_pan_to(double const Horizontal, double const Vertical);
|
||||
void ortho_pan_stop();
|
||||
// camera fly-mode (right mouse button held); used to flush motion when it's released
|
||||
|
||||
Reference in New Issue
Block a user