Handled 3d/2d sanity check bug

This commit is contained in:
Joshua Barretto 2020-08-25 12:54:30 +01:00
parent 37b45ba5f4
commit 24780e4f58

View File

@ -197,8 +197,8 @@ impl<'a> System<'a> for Sys {
// Sanity check: don't try colliding entities that are too far from each other
// Note: I think this catches all cases. If you get entity collision problems,
// try removing this!
if (pos.0 - pos_other.0).magnitude()
> ((vel - vel_other) * dt.0).magnitude() + collision_dist
if (pos.0 - pos_other.0).xy().magnitude()
> ((vel - vel_other) * dt.0).xy().magnitude() + collision_dist
{
continue;
}