Open Source Tomb Raider Engine
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.

BoundingBox.h 706B

123456789101112131415161718192021222324252627282930313233343536
  1. /*!
  2. * \file include/BoundingBox.h
  3. * \brief 3D Axis Aligned Bounding Box
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _BOUNDING_BOX_H_
  8. #define _BOUNDING_BOX_H_
  9. #include <array>
  10. #include <vector>
  11. class BoundingBox {
  12. public:
  13. BoundingBox(glm::vec3 min, glm::vec3 max);
  14. bool inBox(glm::vec3 p);
  15. bool inBoxPlane(glm::vec3 p);
  16. glm::vec3 getCorner(int i) { return corner.at(i); }
  17. void display(glm::mat4 VP, glm::vec3 colorLine, glm::vec3 colorDot);
  18. static void display();
  19. private:
  20. std::array<glm::vec3, 8> corner;
  21. static std::vector<glm::vec4> vertices;
  22. static std::vector<glm::vec3> colorsLine, colorsPoint;
  23. static std::vector<unsigned short> indicesLine;
  24. };
  25. #endif