diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-14 01:52:02 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-14 01:52:02 +0000 |
commit | 21e1a24ebe3b4a4679702314ee77dc5259d13070 (patch) | |
tree | b458f0b86c1b60fe1ccd48f505a4d4eb0e6fce49 /gfx/camera.h | |
parent | Fix ratio to include return type in common intermediary type (diff) | |
download | ilt-21e1a24ebe3b4a4679702314ee77dc5259d13070.tar.bz2 ilt-21e1a24ebe3b4a4679702314ee77dc5259d13070.tar.xz ilt-21e1a24ebe3b4a4679702314ee77dc5259d13070.zip |
Add support for changing the aspect ratio of a camera
Diffstat (limited to 'gfx/camera.h')
-rw-r--r-- | gfx/camera.h | 7 |
1 files changed, 5 insertions, 2 deletions
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<GlobalPosition3D> 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; |