CollisionEventArgs.cs 794 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. namespace MonoGame.Extended.Collisions
  4. {
  5. /// <summary>
  6. /// This class holds data on a collision. It is passed as a parameter to
  7. /// OnCollision methods.
  8. /// </summary>
  9. public class CollisionEventArgs : EventArgs
  10. {
  11. /// <summary>
  12. /// Gets the object being collided with.
  13. /// </summary>
  14. public required ICollisionActor Other { get; init; }
  15. /// <summary>
  16. /// Gets a vector representing the overlap between the two objects.
  17. /// </summary>
  18. /// <remarks>
  19. /// This vector starts at the edge of <see cref="Other"/> and ends at
  20. /// the Actor's location.
  21. /// </remarks>
  22. public required Vector2 PenetrationVector { get; init; }
  23. }
  24. }