Syntriax.Engine/Engine.Physics2D/Abstract/ICollider2D.cs

42 lines
1.2 KiB
C#
Raw Normal View History

using System;
2024-01-25 21:54:39 +03:00
using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Physics2D.Abstract;
2024-02-01 12:26:28 +03:00
/// <summary>
/// Represents a 2D collider.
/// </summary>
public interface ICollider2D : IBehaviour, IAssignableTransform
{
2024-02-01 12:26:28 +03:00
/// <summary>
/// Event triggered when a collision is detected.
/// </summary>
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionDetected { get; set; }
2024-02-01 12:26:28 +03:00
/// <summary>
/// Event triggered when a collision is resolved.
/// </summary>
2024-01-27 19:22:59 +03:00
Action<ICollider2D, CollisionDetectionInformation>? OnCollisionResolved { get; set; }
2024-02-01 12:26:28 +03:00
/// <summary>
/// Event triggered when another <see cref="ICollider2D"/> triggers this <see cref="ICollider2D"/>.
/// </summary>
2024-01-27 20:31:51 +03:00
Action<ICollider2D, ICollider2D>? OnTriggered { get; set; }
2024-02-01 12:26:28 +03:00
/// <summary>
/// The <see cref="IRigidBody2D"/> associated with the <see cref="ICollider2D"/>.
/// </summary>
IRigidBody2D? RigidBody2D { get; }
2024-02-01 12:26:28 +03:00
/// <summary>
/// The value indicating whether the <see cref="ICollider2D"/> is a trigger.
/// </summary>
2024-01-27 20:19:00 +03:00
bool IsTrigger { get; set; }
2024-02-01 12:26:28 +03:00
/// <summary>
/// Recalculates <see cref="ICollider2D"/> properties.
/// </summary>
void Recalculate();
}