BsConvexVolume.h 929 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "BsPrerequisitesUtil.h"
  3. #include "BsPlane.h"
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Math
  7. * @{
  8. */
  9. /** Represents a convex volume defined by planes representing the volume border. */
  10. class BS_UTILITY_EXPORT ConvexVolume
  11. {
  12. public:
  13. ConvexVolume() {}
  14. ConvexVolume(const Vector<Plane>& planes);
  15. /**
  16. * 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. * 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. /** Returns the internal set of planes that represent the volume. */
  26. Vector<Plane> getPlanes() const { return mPlanes; }
  27. private:
  28. Vector<Plane> mPlanes;
  29. };
  30. /** @} */
  31. }