diff options
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/camera_controller.h | 3 | ||||
-rw-r--r-- | gfx/followCameraController.cpp | 4 | ||||
-rw-r--r-- | gfx/followCameraController.h | 3 | ||||
-rw-r--r-- | gfx/manualCameraController.cpp | 3 | ||||
-rw-r--r-- | gfx/manualCameraController.h | 3 |
5 files changed, 5 insertions, 11 deletions
diff --git a/gfx/camera_controller.h b/gfx/camera_controller.h index cdc70d2..926c93b 100644 --- a/gfx/camera_controller.h +++ b/gfx/camera_controller.h @@ -4,11 +4,10 @@ #include <game/worldobject.h> class Camera; -class Shader; class CameraController : public WorldObject { public: - virtual void updateCamera(Camera *, Shader *) const = 0; + virtual void updateCamera(Camera *) const = 0; }; #endif diff --git a/gfx/followCameraController.cpp b/gfx/followCameraController.cpp index 0034c3b..4db77cd 100644 --- a/gfx/followCameraController.cpp +++ b/gfx/followCameraController.cpp @@ -12,7 +12,7 @@ FollowCameraController::FollowCameraController(VehicleWPtr t, Mode m) : target(std::move(t)), mode(m) { } void -FollowCameraController::updateCamera(Camera * camera, Shader * shader) const +FollowCameraController::updateCamera(Camera * camera) const { const auto [pos, rot] = [this]() { const auto t {target.lock()}; @@ -37,6 +37,4 @@ FollowCameraController::updateCamera(Camera * camera, Shader * shader) const camera->up = glm::normalize(up - north - east); break; } - - shader->setView(camera->GetViewProjection()); } diff --git a/gfx/followCameraController.h b/gfx/followCameraController.h index d57b59f..ef2000d 100644 --- a/gfx/followCameraController.h +++ b/gfx/followCameraController.h @@ -6,7 +6,6 @@ #include <gfx/camera_controller.h> class Camera; -class Shader; class FollowCameraController : public CameraController { public: @@ -15,7 +14,7 @@ public: void tick(TickDuration) override { } - void updateCamera(Camera * camera, Shader * shader) const override; + void updateCamera(Camera * camera) const override; private: VehicleWPtr target; diff --git a/gfx/manualCameraController.cpp b/gfx/manualCameraController.cpp index 36f3312..f8cdbf8 100644 --- a/gfx/manualCameraController.cpp +++ b/gfx/manualCameraController.cpp @@ -48,7 +48,7 @@ ManualCameraController::handleInput(SDL_Event & e) } void -ManualCameraController::updateCamera(Camera * camera, Shader * shader) const +ManualCameraController::updateCamera(Camera * camera) const { if (motion) { if (ctrl) { @@ -59,7 +59,6 @@ ManualCameraController::updateCamera(Camera * camera, Shader * shader) const camera->MoveRight(motion->xrel); camera->SlideForward(motion->yrel); } - shader->setView(camera->GetViewProjection()); motion.reset(); } } diff --git a/gfx/manualCameraController.h b/gfx/manualCameraController.h index 112ec5c..465f31f 100644 --- a/gfx/manualCameraController.h +++ b/gfx/manualCameraController.h @@ -8,7 +8,6 @@ #include <optional> class Camera; -class Shader; class ManualCameraController : public CameraController, public InputHandler { public: @@ -16,7 +15,7 @@ public: void tick(TickDuration) override { } - void updateCamera(Camera * camera, Shader * shader) const override; + void updateCamera(Camera * camera) const override; private: bool ctrl {false}, mrb {false}; |