15 lines
564 B
C#
15 lines
564 B
C#
using Syntriax.Engine.Physics2D.Abstract;
|
|
using Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
namespace Syntriax.Engine.Physics2D;
|
|
|
|
public class Collider2DShapeBehaviour : Collider2DBehaviourBase, IShapeCollider2D
|
|
{
|
|
public Shape ShapeWorld => _shapeWorld;
|
|
public Shape ShapeLocal { get; set; } = new([new(1f, 1f), new(-1f, 1f), new(-1f, -1f), new(1f, -1f)]);
|
|
|
|
protected Shape _shapeWorld = new([new(1f, 1f), new(-1f, 1f), new(-1f, -1f), new(1f, -1f)]);
|
|
|
|
public override void CalculateCollider() => Transform.TransformShape(ShapeLocal, ref _shapeWorld);
|
|
}
|