Syntriax.Engine/Engine.Physics2D/Abstract/ICollisionDetector2D.cs

21 lines
965 B
C#
Raw Permalink Normal View History

2024-01-25 18:21:52 +03:00
using Syntriax.Engine.Physics2D.Abstract;
namespace Syntriax.Engine.Physics2D;
2024-02-01 12:26:28 +03:00
/// <summary>
/// Represents a 2D collision detector.
/// </summary>
public interface ICollisionDetector2D
2024-01-25 18:21:52 +03:00
{
2024-02-01 12:26:28 +03:00
/// <summary>
/// Attempts to detect a collision between two <see cref="ICollider2D"/>s.
/// </summary>
/// <typeparam name="T1">Type of the first <see cref="ICollider2D"/>.</typeparam>
/// <typeparam name="T2">Type of the second <see cref="ICollider2D"/>.</typeparam>
/// <param name="left">The first <see cref="ICollider2D"/>.</param>
/// <param name="right">The second <see cref="ICollider2D"/>.</param>
/// <param name="collisionInformation">Information about the collision.</param>
/// <returns><see cref="true"/> if a collision is detected, otherwise <see cref="false"/>.</returns>
bool TryDetect<T1, T2>(T1 left, T2 right, out CollisionDetectionInformation collisionInformation) where T1 : ICollider2D where T2 : ICollider2D;
2024-01-25 18:21:52 +03:00
}