refactor: Improved Shape & Circle Code Readability

This commit is contained in:
2024-01-27 20:20:28 +03:00
parent ab2489f6cf
commit 15788f2eca
2 changed files with 4 additions and 6 deletions

View File

@@ -5,10 +5,9 @@ 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)]);
public Shape ShapeWorld { get; protected set; } = Shape.Box;
public Shape ShapeLocal { get; set; } = Shape.Box;
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);