fix: Shape to Shape Detection
This commit is contained in:
parent
058c6dafe3
commit
c32add40ff
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue