refactor: Renamed OnCollisionPreResolve to OnCollisionDetected
This commit is contained in:
parent
05d88f7ca2
commit
4d9121118d
|
@ -6,7 +6,7 @@ namespace Syntriax.Engine.Physics2D.Abstract;
|
||||||
|
|
||||||
public interface ICollider2D : IBehaviour, IAssignableTransform
|
public interface ICollider2D : IBehaviour, IAssignableTransform
|
||||||
{
|
{
|
||||||
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionPreResolve { get; set; }
|
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionDetected { get; set; }
|
||||||
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionResolved { get; set; }
|
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionResolved { get; set; }
|
||||||
|
|
||||||
IRigidBody2D? RigidBody2D { get; }
|
IRigidBody2D? RigidBody2D { get; }
|
||||||
|
|
|
@ -62,8 +62,8 @@ public class PhysicsEngine2D : IPhysicsEngine2D
|
||||||
|
|
||||||
if (collisionDetector.TryDetect(colliderX, colliderY, out CollisionDetectionInformation information))
|
if (collisionDetector.TryDetect(colliderX, colliderY, out CollisionDetectionInformation information))
|
||||||
{
|
{
|
||||||
colliderX.OnCollisionPreResolve?.Invoke(colliderX, information);
|
colliderX.OnCollisionDetected?.Invoke(colliderX, information);
|
||||||
colliderY.OnCollisionPreResolve?.Invoke(colliderY, information);
|
colliderY.OnCollisionDetected?.Invoke(colliderY, information);
|
||||||
|
|
||||||
Vector2D displacementVector = information.Normal * information.Penetration;
|
Vector2D displacementVector = information.Normal * information.Penetration;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue