From b28b16746729a44cf7166f79d51d26d2dd6674e0 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 19 Oct 2024 12:02:53 +0200 Subject: [PATCH] Recast: fix regression in geometry raycaster After the implementation of brush intersection detection in commit 6fa5080fe51e2ea118f2cf4f922bcb6e815b3a9f, we return out as soon as we have a hit, even when tmin is provided. But if tmin is provided, the caller is interested in finding the closest intersection so we must go over the input mesh as well. This fixes a bug of raycasts going through geometry when there's a brush behind it. --- src/naveditor/InputGeom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/naveditor/InputGeom.cpp b/src/naveditor/InputGeom.cpp index 64cff781..0dce3d59 100644 --- a/src/naveditor/InputGeom.cpp +++ b/src/naveditor/InputGeom.cpp @@ -557,8 +557,8 @@ bool InputGeom::raycastMesh(const float* src, const float* dst, const unsigned i if (tmin) *tmin = isectTmin; - - return true; + else + return true; } const bool traceWorld = mask & TRACE_WORLD;