32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
namespace Syntriax.Engine.Physics2D.Abstract;
|
|
|
|
/// <summary>
|
|
/// Represents a 2D physics engine.
|
|
/// </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>
|
|
int IterationPerStep { get; set; }
|
|
|
|
/// <summary>
|
|
/// Advances the physics simulation by the specified time.
|
|
/// </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);
|
|
}
|