BsConvexVolume.h 734 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "BsPrerequisitesUtil.h"
  3. #include "BsPlane.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Represents a convex volume defined by planes representing
  8. * the volume border.
  9. */
  10. class BS_UTILITY_EXPORT ConvexVolume
  11. {
  12. public:
  13. ConvexVolume(const Vector<Plane>& planes);
  14. /**
  15. * @brief Checks does the volume intersects the provided axis aligned box.
  16. * This will return true if the box is fully inside the volume.
  17. */
  18. bool intersects(const AABox& box) const;
  19. /**
  20. * @brief Checks does the volume intersects the provided sphere.
  21. * This will return true if the sphere is fully inside the volume.
  22. */
  23. bool intersects(const Sphere& sphere) const;
  24. private:
  25. Vector<Plane> mPlanes;
  26. };
  27. }