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.

BoundingSphere.h 771B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*!
  2. * \file include/BoundingSphere.h
  3. * \brief 3D Bounding Sphere
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _BOUNDING_SPHERE_H_
  8. #define _BOUNDING_SPHERE_H_
  9. #include <vector>
  10. class BoundingSphere {
  11. public:
  12. BoundingSphere(glm::vec3 p = glm::vec3(0.0f, 0.0f, 0.0f), float r = 100.0f, int res = 42) : pos(p),
  13. radius(r), resolution(res) { }
  14. void setPosition(glm::vec3 p) { pos = p; }
  15. glm::vec3 getPosition() { return pos; }
  16. void setRadius(float r) { radius = r; }
  17. float getRadius() { return radius; }
  18. void display(glm::mat4 VP, glm::vec3 color);
  19. static void display();
  20. private:
  21. glm::vec3 pos;
  22. float radius;
  23. int resolution;
  24. static std::vector<glm::vec4> vertices;
  25. static std::vector<glm::vec3> colors;
  26. };
  27. #endif