summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/gameMainWindow.cpp2
-rw-r--r--ui/manualCameraController.cpp4
-rw-r--r--ui/manualCameraController.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 15f1e07..7cf143a 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -31,7 +31,7 @@ public:
GameMainWindow::GameMainWindow(size_t w, size_t h) :
Window {w, h, "I Like Trains", SDL_WINDOW_OPENGL}, SceneRenderer {Window::size, 0}
{
- uiComponents.create<ManualCameraController>(Position2D {-1150, -1150});
+ uiComponents.create<ManualCameraController>(Position2D {-1150000, -1150000});
auto gms = uiComponents.create<GameMainSelector>(&camera, ScreenAbsCoord {w, h});
uiComponents.create<GameMainToolbar>(gms.get());
}
diff --git a/ui/manualCameraController.cpp b/ui/manualCameraController.cpp
index 05c1fc5..f6993a8 100644
--- a/ui/manualCameraController.cpp
+++ b/ui/manualCameraController.cpp
@@ -59,12 +59,12 @@ ManualCameraController::handleInput(const SDL_Event & e, const Position &)
pitch = std::clamp(pitch - 0.01F * static_cast<float>(e.motion.yrel), 0.1F, half_pi);
}
else {
- focus += rotate_flat(-direction) * Position2D {-e.motion.xrel, e.motion.yrel};
+ focus += rotate_flat(-direction) * (Position2D {-e.motion.xrel, e.motion.yrel} * dist / 2.0F);
}
}
return true;
case SDL_MOUSEWHEEL:
- dist = std::clamp(dist - static_cast<float>(e.wheel.y) * 4.F, 5.F, 200.F);
+ dist = std::clamp(dist - static_cast<float>(e.wheel.y) * 400.F, 5.F, 200000.F);
break;
}
return false;
diff --git a/ui/manualCameraController.h b/ui/manualCameraController.h
index 46655bc..1efaee1 100644
--- a/ui/manualCameraController.h
+++ b/ui/manualCameraController.h
@@ -22,5 +22,5 @@ private:
bool ctrl {false}, mrb {false};
Position2D focus;
float direction {quarter_pi};
- float dist {40}, pitch {quarter_pi};
+ float dist {4000}, pitch {quarter_pi};
};