From b7b1154f29310bb39f67423d11a838acda523665 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 5 Feb 2026 23:43:17 +0300 Subject: [PATCH] simplified shit --- include/omath/collision/simplex.hpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/include/omath/collision/simplex.hpp b/include/omath/collision/simplex.hpp index 7820f53..bbdd9af 100644 --- a/include/omath/collision/simplex.hpp +++ b/include/omath/collision/simplex.hpp @@ -158,21 +158,11 @@ namespace omath::collision { // ReSharper disable once CppTooWideScopeInitStatement auto n = ab.cross(ao); // Needed to valid handle collision if colliders placed at same origin pos - if (near_zero(n)) - { - // collinear: origin lies on ray AB (often on segment), pick any perp to escape - direction = any_perp(ab); - } - else - { - direction = n.cross(ab); - } - } - else - { - *this = {a}; - direction = ao; + direction = near_zero(n) ? any_perp(ab) : n.cross(ab); + return false; } + *this = {a}; + direction = ao; return false; }