summaryrefslogtreecommitdiff
path: root/game/geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-02-24 00:10:27 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-02-24 00:10:27 +0000
commit80529930ea3bc874c8da22c66343745ff6fdd45b (patch)
tree6441b090f24cf33638c5257e6b9eea4f14929503 /game/geoData.cpp
parentMerge branch 'glcontainer-fix' (diff)
downloadilt-80529930ea3bc874c8da22c66343745ff6fdd45b.tar.bz2
ilt-80529930ea3bc874c8da22c66343745ff6fdd45b.tar.xz
ilt-80529930ea3bc874c8da22c66343745ff6fdd45b.zip
Simplify vector addition/subtraction with differnt types
Automatically applies correct rounding with float to int operations, adjusts test expectations accordingly.
Diffstat (limited to 'game/geoData.cpp')
-rw-r--r--game/geoData.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/game/geoData.cpp b/game/geoData.cpp
index b30a35b..359e8c0 100644
--- a/game/geoData.cpp
+++ b/game/geoData.cpp
@@ -204,8 +204,7 @@ GeoData::intersectRay(const Ray<GlobalPosition3D> & ray, FaceHandle face) const
{
std::optional<GlobalPosition3D> out;
walkUntil(PointFace {ray.start, face},
- ray.start.xy()
- + GlobalPosition2D(ray.direction.xy() * RelativePosition2D(upperExtent.xy() - lowerExtent.xy())),
+ ray.start.xy() + (ray.direction.xy() * RelativePosition2D(upperExtent.xy() - lowerExtent.xy())),
[&out, &ray, this](FaceHandle face) {
BaryPosition bari {};
RelativeDistance dist {};