diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-28 13:30:46 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-02-28 13:41:37 +0000 |
| commit | 6b407b2778c69314ba034e9ea265697a51f331d4 (patch) | |
| tree | 7ee7d605a5b6d526fa8edef7359f4601242c4989 /gfx/camera.h | |
| parent | Allow specifying all three partition functions independently (diff) | |
| download | ilt-6b407b2778c69314ba034e9ea265697a51f331d4.tar.bz2 ilt-6b407b2778c69314ba034e9ea265697a51f331d4.tar.xz ilt-6b407b2778c69314ba034e9ea265697a51f331d4.zip | |
Use RelativeDistance in Camera near/fear and expose member variables
Diffstat (limited to 'gfx/camera.h')
| -rw-r--r-- | gfx/camera.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gfx/camera.h b/gfx/camera.h index b17bcbb..b78827a 100644 --- a/gfx/camera.h +++ b/gfx/camera.h @@ -8,7 +8,7 @@ class Camera : public Frustum { public: - Camera(GlobalPosition3D position, Angle fov, Angle aspect, GlobalDistance near, GlobalDistance far); + Camera(GlobalPosition3D position, Angle fov, Angle aspect, RelativeDistance near, RelativeDistance far); [[nodiscard]] Ray<GlobalPosition3D> unProject(const ScreenRelCoord &) const; @@ -61,17 +61,35 @@ public: return forward; } + [[nodiscard]] auto + getNear() const + { + return near; + } + + [[nodiscard]] auto + getFar() const + { + return far; + } + + [[nodiscard]] auto + getDepth() const + { + return far - near; + } + [[nodiscard]] std::array<GlobalPosition4D, 4> extentsAtDist(GlobalDistance) const; [[nodiscard]] static Direction3D upFromForward(const Direction3D & forward); private: - Camera(GlobalPosition3D position, Angle fov, Angle aspect, GlobalDistance near, GlobalDistance far, + Camera(GlobalPosition3D position, Angle fov, Angle aspect, RelativeDistance near, RelativeDistance far, const glm::mat4 & view, const glm::mat4 & projection); void updateView(); Angle fov, aspect; Direction3D forward; Direction3D up; - GlobalDistance near, far; + RelativeDistance near, far; }; |
