Refactor: CollisionDetectionInformation Names

This commit is contained in:
2024-11-03 20:25:28 +03:00
parent 4856800f5f
commit 55ed8b84f6
5 changed files with 31 additions and 13 deletions

View File

@@ -91,8 +91,16 @@ public class PhysicsEngine2D : IPhysicsEngine2D
continue;
}
colliderX.Detect(information);
colliderY.Detect(information);
if (information.Detector == colliderX)
{
colliderX.Detect(information);
colliderY.Detect(information.Reverse());
}
else
{
colliderX.Detect(information.Reverse());
colliderY.Detect(information);
}
collisionResolver?.Resolve(information);
}