]> git.localhorst.tv Git - blank.git/blob - src/model/bounds.hpp
renamed Shape -> CollisionBounds
[blank.git] / src / model / bounds.hpp
1 #ifndef BLANK_MODEL_BOUNDS_HPP_
2 #define BLANK_MODEL_BOUNDS_HPP_
3
4 #include "CollisionBounds.hpp"
5 #include "geometry.hpp"
6
7 #include <vector>
8 #include <glm/glm.hpp>
9
10
11 namespace blank {
12
13 class NullBounds
14 : public CollisionBounds {
15
16 public:
17         NullBounds();
18
19         bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
20         bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
21
22 };
23
24
25 class CuboidBounds
26 : public CollisionBounds {
27
28 public:
29         CuboidBounds(const AABB &bounds);
30
31         bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
32         bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
33
34 private:
35         AABB bb;
36
37 };
38
39
40 class StairBounds
41 : public CollisionBounds {
42
43 public:
44         StairBounds(const AABB &bounds, const glm::vec2 &clip);
45
46         bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
47         bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override;
48
49 private:
50         AABB top, bot;
51
52 };
53
54 }
55
56 #endif