mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-12 22:53:27 +00:00
simplified shit
This commit is contained in:
@@ -158,21 +158,11 @@ namespace omath::collision
|
|||||||
{
|
{
|
||||||
// ReSharper disable once CppTooWideScopeInitStatement
|
// ReSharper disable once CppTooWideScopeInitStatement
|
||||||
auto n = ab.cross(ao); // Needed to valid handle collision if colliders placed at same origin pos
|
auto n = ab.cross(ao); // Needed to valid handle collision if colliders placed at same origin pos
|
||||||
if (near_zero(n))
|
direction = near_zero(n) ? any_perp(ab) : n.cross(ab);
|
||||||
{
|
return false;
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
*this = {a};
|
||||||
|
direction = ao;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user