From 21e1a24ebe3b4a4679702314ee77dc5259d13070 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 14 Mar 2025 01:52:02 +0000 Subject: Add support for changing the aspect ratio of a camera --- gfx/camera.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gfx/camera.h') diff --git a/gfx/camera.h b/gfx/camera.h index d1bfc82..b17bcbb 100644 --- a/gfx/camera.h +++ b/gfx/camera.h @@ -12,6 +12,8 @@ public: [[nodiscard]] Ray unProject(const ScreenRelCoord &) const; + void setAspect(Angle aspect); + void setPosition(const GlobalPosition3D & p) { @@ -64,10 +66,11 @@ public: [[nodiscard]] static Direction3D upFromForward(const Direction3D & forward); private: - Camera(GlobalPosition3D position, GlobalDistance near, GlobalDistance far, const glm::mat4 & view, - const glm::mat4 & projection); + Camera(GlobalPosition3D position, Angle fov, Angle aspect, GlobalDistance near, GlobalDistance far, + const glm::mat4 & view, const glm::mat4 & projection); void updateView(); + Angle fov, aspect; Direction3D forward; Direction3D up; GlobalDistance near, far; -- cgit v1.2.3