feat: IPhysicsEngine2D Events

This commit is contained in:
2024-10-25 23:10:32 +03:00
parent 9c2b098821
commit 62e50aefc1
3 changed files with 24 additions and 1 deletions

View File

@@ -5,6 +5,16 @@ namespace Syntriax.Engine.Physics2D.Abstract;
/// </summary>
public interface IPhysicsEngine2D
{
/// <summary>
/// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a single physics iteration.
/// </summary>
event OnPhysicsIterationDelegate? OnPhysicsIteration;
/// <summary>
/// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a full physics step/>.
/// </summary>
event OnPhysicsStepDelegate? OnPhysicsStep;
/// <summary>
/// The number of iterations the <see cref="IPhysicsEngine2D"/> performs per step.
/// </summary>
@@ -15,4 +25,7 @@ public interface IPhysicsEngine2D
/// </summary>
/// <param name="deltaTime">The time step.</param>
void Step(float deltaTime);
delegate void OnPhysicsIterationDelegate(IPhysicsEngine2D sender, float iterationDeltaTime);
delegate void OnPhysicsStepDelegate(IPhysicsEngine2D sender, float stepDeltaTime);
}