From 7c9cc222b0456825644c0fc6eeae9a4016e46d4e Mon Sep 17 00:00:00 2001 From: Alex Nichol Date: Fri, 1 Mar 2024 12:04:14 -0500 Subject: [PATCH] change collision logic to return inside point --- model3d/collisions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model3d/collisions.go b/model3d/collisions.go index 629b332..e75aeb8 100644 --- a/model3d/collisions.go +++ b/model3d/collisions.go @@ -512,7 +512,8 @@ func (s *SolidCollider) bisectCollision(r *Ray, min, max float64) float64 { min = f } } - return (min + max) / 2 + // Always return the point inside the solid + return max } func (s *SolidCollider) approximateNormal(c Coord3D) Coord3D {