summaryrefslogtreecommitdiff
path: root/gfx/gl/camera.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-12-17 18:57:15 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-12-17 18:57:15 +0000
commit512a47b2b8a7248b640441a828c2ea5f97dc385f (patch)
tree8ec395500e5228e3f9486602688c675753fd2d9e /gfx/gl/camera.cpp
parentUse new calc types in geoData (diff)
downloadilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.tar.bz2
ilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.tar.xz
ilt-512a47b2b8a7248b640441a828c2ea5f97dc385f.zip
Use new calc types in camera extents to address overflow
Diffstat (limited to 'gfx/gl/camera.cpp')
-rw-r--r--gfx/gl/camera.cpp6
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};
};