fix: Physics Engine Not Resolving Static Objects Correctly

This commit is contained in:
Syntriax 2024-11-02 09:39:53 +03:00
parent d7f0b76485
commit 9f522bdb66
2 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ public class PhysicsEngine2D : IPhysicsEngine2D
if (bothCollidersAreTriggers)
continue;
bool bothCollidersAreStatic = colliderX.RigidBody2D?.IsStatic ?? true && colliderX.RigidBody2D?.IsStatic == colliderY.RigidBody2D?.IsStatic;
bool bothCollidersAreStatic = (colliderX.RigidBody2D?.IsStatic ?? true) && (colliderY.RigidBody2D?.IsStatic ?? true);
if (bothCollidersAreStatic)
continue;

View File

@ -56,7 +56,7 @@ public class PhysicsEngine2DCollector : HierarchyObjectBase, IPhysicsEngine2D
if (bothCollidersAreTriggers)
continue;
bool bothCollidersAreStatic = colliderX.RigidBody2D?.IsStatic ?? true && colliderX.RigidBody2D?.IsStatic == colliderY.RigidBody2D?.IsStatic;
bool bothCollidersAreStatic = (colliderX.RigidBody2D?.IsStatic ?? true) && (colliderY.RigidBody2D?.IsStatic ?? true);
if (bothCollidersAreStatic)
continue;