diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-12-17 18:57:15 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-12-17 18:57:15 +0000 |
commit | 512a47b2b8a7248b640441a828c2ea5f97dc385f (patch) | |
tree | 8ec395500e5228e3f9486602688c675753fd2d9e /gfx | |
parent | Use new calc types in geoData (diff) | |
download | ilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.tar.bz2 ilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.tar.xz ilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.zip |
Use new calc types in camera extents to address overflow
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/gl/camera.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/gl/camera.cpp b/gfx/gl/camera.cpp index ff4c91e..06e409e 100644 --- a/gfx/gl/camera.cpp +++ b/gfx/gl/camera.cpp @@ -41,9 +41,9 @@ Camera::extentsAtDist(const GlobalDistance dist) const const auto clampToSeaFloor = [this, dist](GlobalPosition3D target) -> GlobalPosition4D { target += position; if (target.z < -1500) { - const auto diff = target - position; - const auto limit = -1500 - position.z; - return {position + (limit * diff) / diff.z, (limit * dist) / diff.z}; + const CalcPosition3D diff = target - position; + const CalcDistance limit = -1500 - position.z; + return {position + GlobalPosition3D((limit * diff) / diff.z), (limit * dist) / diff.z}; } return {target, dist}; }; |