mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
feat(editor): scroll wheel zoom, clickable minimap navigation
- Scroll wheel now zooms camera (moves along look direction) instead of adjusting speed. Much more intuitive for terrain editing. - Shift+scroll adjusts camera speed (old behavior preserved) - Click on minimap to teleport camera to that location on the terrain - Zoom speed scales with current camera speed for consistent feel
This commit is contained in:
parent
f891bd02a5
commit
12acbfb2d5
4 changed files with 23 additions and 4 deletions
|
|
@ -43,8 +43,14 @@ void EditorCamera::processMouseMotion(int dx, int dy) {
|
|||
camera_.setRotation(yaw_, pitch_);
|
||||
}
|
||||
|
||||
void EditorCamera::processMouseWheel(float delta) {
|
||||
speed_ = std::clamp(speed_ + delta * 20.0f, 10.0f, 2000.0f);
|
||||
void EditorCamera::processMouseWheel(float delta, bool shiftHeld) {
|
||||
if (shiftHeld) {
|
||||
speed_ = std::clamp(speed_ + delta * 20.0f, 10.0f, 2000.0f);
|
||||
} else {
|
||||
glm::vec3 pos = camera_.getPosition();
|
||||
pos += camera_.getForward() * delta * speed_ * 0.3f;
|
||||
camera_.setPosition(pos);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorCamera::processKeyEvent(const SDL_KeyboardEvent& event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue