Syntriax.Engine/Engine.Physics2D/Collider2DShapeBehaviour.cs

15 lines
558 B
C#
Raw Normal View History

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
{
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)]);
2024-01-25 20:42:49 +03:00
public override void Recalculate() => Transform.TransformShape(ShapeLocal, ref _shapeWorld);
2024-01-24 19:21:53 +03:00
}