BREAKING CHANGE: New ICollider

This commit is contained in:
2024-01-24 19:21:53 +03:00
parent 350ef030ac
commit ed15238dcd
11 changed files with 123 additions and 77 deletions

View File

@@ -0,0 +1,9 @@
using Syntriax.Engine.Physics2D.Primitives;
namespace Syntriax.Engine.Physics2D.Abstract;
public interface ICircleCollider2D : ICollider2D
{
Circle CircleLocal { get; set; }
Circle CircleWorld { get; }
}

View File

@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Syntriax.Engine.Core;
using Syntriax.Engine.Core.Abstract;
@@ -9,11 +7,9 @@ namespace Syntriax.Engine.Physics2D.Abstract;
public interface ICollider2D : IBehaviour, IAssignableTransform
{
Action<ICollider2D, ICollider2D>? OnCollisionPreResolve { get; set; }
Action<ICollider2D, ICollider2D>? OnCollisionResolved { get; set; }
IRigidBody2D? RigidBody2D { get; }
IList<Vector2D> Vertices { get; }
bool CheckCollision(Vector2D point);
void Recalculate();
}

View File

@@ -11,4 +11,5 @@ public interface IRigidBody2D : IBehaviour, IAssignableTransform
float AngularVelocity { get; set; }
float Mass { get; set; }
bool IsStatic { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Syntriax.Engine.Physics2D.Primitives;
namespace Syntriax.Engine.Physics2D.Abstract;
public interface IShapeCollider2D : ICollider2D
{
Shape ShapeLocal { get; set; }
Shape ShapeWorld { get; }
}