BsConvexVolume.h 901 B

1234567891011121314151617181920212223242526272829303132333435363738
  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() {}
  14. ConvexVolume(const Vector<Plane>& planes);
  15. /**
  16. * @brief Checks does the volume intersects the provided axis aligned box.
  17. * This will return true if the box is fully inside the volume.
  18. */
  19. bool intersects(const AABox& box) const;
  20. /**
  21. * @brief Checks does the volume intersects the provided sphere.
  22. * This will return true if the sphere is fully inside the volume.
  23. */
  24. bool intersects(const Sphere& sphere) const;
  25. /**
  26. * @brief Returns the internal set of planes that represent the volume.
  27. */
  28. const Vector<Plane> getPlanes() const { return mPlanes; }
  29. private:
  30. Vector<Plane> mPlanes;
  31. };
  32. }