IEntity.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // An entity is the basic renderable entity, eg something you can draw.
  4. // Entities don't have transformations of their own; instead, you put them inside
  5. // nodes which handle matrices and transformations for them.
  6. //
  7. // Author: Ronen Ness.
  8. // Since: 2017.
  9. //-----------------------------------------------------------------------------
  10. #endregion
  11. using Microsoft.Xna.Framework;
  12. namespace MonoGameSceneGraph
  13. {
  14. /// <summary>
  15. /// A basic renderable entity.
  16. /// </summary>
  17. public interface IEntity
  18. {
  19. /// <summary>
  20. /// Draw this entity.
  21. /// </summary>
  22. /// <param name="parent">Parent node that's currently drawing this entity.</param>
  23. /// <param name="localTransformations">Local transformations from the direct parent node.</param>
  24. /// <param name="worldTransformations">World transformations to apply on this entity (this is what you should use to draw this entity).</param>
  25. void Draw(Node parent, Matrix localTransformations, Matrix worldTransformations);
  26. /// <summary>
  27. /// Get the bounding box of this entity (in world space).
  28. /// </summary>
  29. /// <param name="parent">Parent node that's currently drawing this entity.</param>
  30. /// <param name="localTransformations">Local transformations from the direct parent node.</param>
  31. /// <param name="worldTransformations">World transformations to apply on this entity (this is what you should use to draw this entity).</param>
  32. /// <returns>Bounding box of the entity, in world space.</returns>
  33. BoundingBox GetBoundingBox(Node parent, Matrix localTransformations, Matrix worldTransformations);
  34. /// <summary>
  35. /// Return if the entity is currently visible.
  36. /// </summary>
  37. /// <returns>If the entity is visible or not.</returns>
  38. bool Visible { get; set; }
  39. }
  40. }