21 lines
		
	
	
		
			636 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			636 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using Engine.Core;
 | 
						|
 | 
						|
namespace Engine.Physics2D;
 | 
						|
 | 
						|
[System.Diagnostics.DebuggerDisplay("Normal: {Normal.ToString(), nq}, Penetration: {Penetration}")]
 | 
						|
public readonly struct CollisionDetectionInformation
 | 
						|
(
 | 
						|
    ICollider2D Detector,
 | 
						|
    ICollider2D Detected,
 | 
						|
    Vector2D Normal,
 | 
						|
    float Penetration
 | 
						|
)
 | 
						|
{
 | 
						|
    public ICollider2D Detector { get; init; } = Detector;
 | 
						|
    public ICollider2D Detected { get; init; } = Detected;
 | 
						|
    public Vector2D Normal { get; init; } = Normal;
 | 
						|
    public float Penetration { get; init; } = Penetration;
 | 
						|
 | 
						|
    public CollisionDetectionInformation Reverse() => new(Detected, Detector, -Normal, Penetration);
 | 
						|
}
 |