Simple game engine with complete export to scripting language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
790 B

  1. #ifndef BLUECORE_BOUNDING_CUBE_H
  2. #define BLUECORE_BOUNDING_CUBE_H
  3. #include "Math/Transformation.h"
  4. namespace BlueCore
  5. {
  6. class AABB
  7. {
  8. public:
  9. Vector3 Min;
  10. Vector3 Max;
  11. bool overlaps (const AABB &aabb)
  12. {
  13. bool overlap = true;
  14. overlap = (Min.x > aabb.Max.x || Max.x < aabb.Min.x) ? false : overlap;
  15. overlap = (Min.y > aabb.Max.y || Max.y < aabb.Min.y) ? false : overlap;
  16. overlap = (Min.z > aabb.Max.z || Max.z < aabb.Min.z) ? false : overlap;
  17. return overlap;
  18. }
  19. AABB transformed (const Transformation& transformation)
  20. {
  21. AABB aabb;
  22. /*
  23. Vector3 new_max = transformation.transform (Max);
  24. Vector3 new_min = transformation.transform (Min);
  25. */
  26. return aabb;
  27. }
  28. };
  29. }
  30. #endif