using System.Runtime.InteropServices;
using GlitchyEngine.Core;
namespace GlitchyEngine.Physics;
[StructLayout(LayoutKind.Sequential, Pack=1)]
public struct Collision2D
{
private UUID _entity;
private UUID _otherEntity;
private UUID _rigidbody;
private UUID _otherRigidbody;
///
/// Gets the Entity whose Collider takes part in the collision.
/// This entity is either the entity of the script instance receiving the event or a child of it.
///
public Entity Entity => new(_entity);
///
/// Gets the other Entity whose collider takes part in the collision.
///
public Entity OtherEntity => new(_otherEntity);
///
/// Gets the rigidbody whose Collider takes part in the collision.
/// This Rigidbody is either a component of the entity whose script instance received the event or a parent of it.
///
public Rigidbody2D Rigidbody => new() { Entity = Entity };
///
/// Gets the other rigidbody whose Collider takes part in the collision.
///
public Rigidbody2D OtherRigidbody => new() { Entity = OtherEntity };
}