From b4a3ad95d15ed95e4fbc6bb562c6f89e7c2ebbd5 Mon Sep 17 00:00:00 2001 From: Lukas Werner <lks.werner@fau.de> Date: Tue, 13 Mar 2018 10:44:47 +0100 Subject: [PATCH] Fixed bug in capsule intersection code --- src/pe/raytracing/Intersects.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pe/raytracing/Intersects.h b/src/pe/raytracing/Intersects.h index 20fb957b6..f1dd5d001 100644 --- a/src/pe/raytracing/Intersects.h +++ b/src/pe/raytracing/Intersects.h @@ -231,7 +231,7 @@ inline bool intersects(const CapsuleID capsule, const Ray& ray, real_t& t, Vec3& real_t t0x_left = origin[0] + direction[0]*t0_left; real_t t1x_left = origin[0] + direction[0]*t1_left; - real_t t_left; + real_t t_left = inf; if (t0_left > 0 && t0x_left < -halfLength) { t_left = t0_left; } @@ -251,7 +251,7 @@ inline bool intersects(const CapsuleID capsule, const Ray& ray, real_t& t, Vec3& real_t t0x_right = origin[0] + direction[0]*t0_right; real_t t1x_right = origin[0] + direction[0]*t1_right; - real_t t_right; + real_t t_right = inf; if (t0_right > 0 && t0x_right > halfLength) { t_right = t0_right; } -- GitLab