MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
AABB.hpp
Go to the documentation of this file.
1 #ifndef MOBILERT_ACCELERATORS_AABB_HPP
2 #define MOBILERT_ACCELERATORS_AABB_HPP
3 
5 #include "MobileRT/Material.hpp"
6 #include "MobileRT/Ray.hpp"
7 #include <glm/glm.hpp>
8 #include <vector>
9 
10 namespace MobileRT {
11 
18  class AABB final {
19  private:
20  ::glm::vec3 pointMin_ {};
21  ::glm::vec3 pointMax_ {};
22 
23  private:
24  void checkArguments() const;
25 
26  public:
27  explicit AABB() = default;
28 
29  explicit AABB(const ::glm::vec3 &pointMin, const ::glm::vec3 &pointMax);
30 
31  AABB(const AABB &aabb) = default;
32 
33  AABB(AABB &&aabb) noexcept = default;
34 
35  ~AABB() = default;
36 
37  AABB &operator=(const AABB &aabb) = default;
38 
39  AABB &operator=(AABB &&aabb) noexcept = default;
40 
41  float getSurfaceArea() const;
42 
43  ::glm::vec3 getCentroid() const;
44 
45  bool intersect(const Ray &ray) const;
46 
47  ::glm::vec3 getPointMin() const;
48 
49  ::glm::vec3 getPointMax() const;
50  };
51 
52  AABB surroundingBox(const AABB &box1, const AABB &box2);
53 }//namespace MobileRT
54 
55 #endif //MOBILERT_ACCELERATORS_AABB_HPP
AABB & operator=(const AABB &aabb)=default
::glm::vec3 pointMax_
Definition: AABB.hpp:21
bool intersect(const Ray &ray) const
Definition: AABB.cpp:34
float getSurfaceArea() const
Definition: AABB.cpp:61
::glm::vec3 pointMin_
Definition: AABB.hpp:20
const AABB box1
Definition: TestAABB.cpp:21
::glm::vec3 getPointMax() const
Definition: AABB.cpp:101
::glm::vec3 getCentroid() const
Definition: AABB.cpp:81
AABB surroundingBox(const AABB &box1, const AABB &box2)
Definition: AABB.cpp:113
Definition: AABB.hpp:18
Definition: Ray.hpp:13
~AABB()=default
AABB()=default
void checkArguments() const
Definition: AABB.cpp:22
::glm::vec3 getPointMin() const
Definition: AABB.cpp:92
Definition: AABB.cpp:105