BsConvexVolume.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPrerequisitesUtil.h"
  5. #include "BsPlane.h"
  6. namespace BansheeEngine
  7. {
  8. /** @addtogroup Math
  9. * @{
  10. */
  11. /** Represents a convex volume defined by planes representing the volume border. */
  12. class BS_UTILITY_EXPORT ConvexVolume
  13. {
  14. public:
  15. ConvexVolume() {}
  16. ConvexVolume(const Vector<Plane>& planes);
  17. /**
  18. * Checks does the volume intersects the provided axis aligned box.
  19. * This will return true if the box is fully inside the volume.
  20. */
  21. bool intersects(const AABox& box) const;
  22. /**
  23. * Checks does the volume intersects the provided sphere.
  24. * This will return true if the sphere is fully inside the volume.
  25. */
  26. bool intersects(const Sphere& sphere) const;
  27. /** Returns the internal set of planes that represent the volume. */
  28. Vector<Plane> getPlanes() const { return mPlanes; }
  29. private:
  30. Vector<Plane> mPlanes;
  31. };
  32. /** @} */
  33. }