mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-09 02:23:52 +00:00
feat(editor): middle mouse orbit camera around terrain point
- Middle mouse drag orbits camera around the terrain point under cursor (or 100 units ahead if no terrain hit) - Maintains distance from pivot while rotating yaw/pitch - Much more intuitive for inspecting terrain features, placed objects, and NPC positions from different angles - Works alongside right-drag (free look) and WASD (fly)
This commit is contained in:
parent
62cfb92c38
commit
496f97f9db
3 changed files with 26 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ public:
|
|||
void processMouseWheel(float delta, bool shiftHeld);
|
||||
void processKeyEvent(const SDL_KeyboardEvent& event);
|
||||
void processMouseButton(const SDL_MouseButtonEvent& event);
|
||||
void processMiddleMouseMotion(int dx, int dy, const glm::vec3& pivotPoint);
|
||||
|
||||
rendering::Camera& getCamera() { return camera_; }
|
||||
const rendering::Camera& getCamera() const { return camera_; }
|
||||
|
|
@ -33,6 +34,7 @@ private:
|
|||
bool keyW_ = false, keyA_ = false, keyS_ = false, keyD_ = false;
|
||||
bool keyQ_ = false, keyE_ = false, keyShift_ = false;
|
||||
bool rightMouseDown_ = false;
|
||||
bool middleMouseDown_ = false;
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue