From 512a47b2b8a7248b640441a828c2ea5f97dc385f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 Dec 2023 18:57:15 +0000 Subject: Use new calc types in camera extents to address overflow --- gfx/gl/camera.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gfx') 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}; }; -- cgit v1.2.3