fix: Shape to Shape Detection

This commit is contained in:
Syntriax 2024-01-26 20:35:05 +03:00
parent 058c6dafe3
commit c32add40ff
1 changed files with 4 additions and 0 deletions

View File

@ -39,7 +39,11 @@ public class CollisionDetector : ICollisionDetector
private static bool DetectShapeShape(IShapeCollider2D left, IShapeCollider2D right, out CollisionDetectionInformation? collisionInformation) private static bool DetectShapeShape(IShapeCollider2D left, IShapeCollider2D right, out CollisionDetectionInformation? collisionInformation)
{ {
collisionInformation = default; collisionInformation = default;
return DetectShapeShapeOneWay(left, right, ref collisionInformation) && DetectShapeShapeOneWay(right, left, ref collisionInformation);
}
private static bool DetectShapeShapeOneWay(IShapeCollider2D left, IShapeCollider2D right, ref CollisionDetectionInformation? collisionInformation)
{
var vertices = left.ShapeWorld.Vertices; var vertices = left.ShapeWorld.Vertices;
int count = vertices.Count; int count = vertices.Count;