Open Source Tomb Raider Engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

BoundingBox.h 672B

1234567891011121314151617181920212223242526272829303132333435
  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::vec3> vertices, colorsLine, colorsPoint;
  22. static std::vector<unsigned short> indicesLine;
  23. };
  24. #endif