2024-01-24 19:21:53 +03:00
|
|
|
using Syntriax.Engine.Physics2D.Abstract;
|
|
|
|
using Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
|
|
|
|
namespace Syntriax.Engine.Physics2D;
|
|
|
|
|
2024-01-25 20:42:49 +03:00
|
|
|
public class Collider2DShapeBehaviour : Collider2DBehaviourBase, IShapeCollider2D
|
2024-01-24 19:21:53 +03:00
|
|
|
{
|
2024-01-27 20:34:58 +03:00
|
|
|
public Shape ShapeWorld { get => _shapeWorld; protected set => _shapeWorld = value; }
|
2024-01-27 20:20:28 +03:00
|
|
|
public Shape ShapeLocal { get; set; } = Shape.Box;
|
2024-01-24 19:21:53 +03:00
|
|
|
|
2024-01-27 20:34:58 +03:00
|
|
|
private Shape _shapeWorld = Shape.Box;
|
2024-01-24 19:21:53 +03:00
|
|
|
|
2024-01-25 22:00:49 +03:00
|
|
|
public override void CalculateCollider() => Transform.TransformShape(ShapeLocal, ref _shapeWorld);
|
2024-01-27 20:19:55 +03:00
|
|
|
|
|
|
|
|
|
|
|
public Collider2DShapeBehaviour() { }
|
2024-01-27 21:15:17 +03:00
|
|
|
public Collider2DShapeBehaviour(Shape shape) => ShapeLocal = shape;
|
2024-01-24 19:21:53 +03:00
|
|
|
}
|