BoundingVolume.h 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef BOUNDINGVOLUME_H_
  2. #define BOUNDINGVOLUME_H_
  3. #include "Vector3.h"
  4. #include "Matrix.h"
  5. namespace gameplay
  6. {
  7. /**
  8. * Represents a 3D bounding volumes, which defines both a
  9. * bounding sphere and an axis-aligned bounding box (AABB).
  10. */
  11. class BoundingVolume
  12. {
  13. public:
  14. /**
  15. * Radius of the bounding sphere.
  16. */
  17. float radius;
  18. /**
  19. * Center point of the bounding sphere.
  20. */
  21. Vector3 center;
  22. /**
  23. * Minimum point of the AABB.
  24. */
  25. Vector3 min;
  26. /**
  27. * Maximum point of the AABB.
  28. */
  29. Vector3 max;
  30. /**
  31. * Constructor.
  32. */
  33. BoundingVolume();
  34. /**
  35. * Transforms this bounding volume by the specified matrix.
  36. */
  37. void transform(const Matrix& m);
  38. /**
  39. * Merges this bounding volume with the specified one and
  40. * stores the result in this BoundingVolume.
  41. */
  42. void merge(const BoundingVolume& v);
  43. };
  44. }
  45. #endif