X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2Fbounds.hpp;fp=src%2Fmodel%2Fbounds.hpp;h=05f8df16950f20860269b0fe2bccd4626486f543;hb=b61d462707dd3d40a32a6104d88eb24f6a52df63;hp=0000000000000000000000000000000000000000;hpb=eba29c8ad489194cd1e3cd64b5f23424ad4384ef;p=blank.git diff --git a/src/model/bounds.hpp b/src/model/bounds.hpp new file mode 100644 index 0000000..05f8df1 --- /dev/null +++ b/src/model/bounds.hpp @@ -0,0 +1,56 @@ +#ifndef BLANK_MODEL_BOUNDS_HPP_ +#define BLANK_MODEL_BOUNDS_HPP_ + +#include "CollisionBounds.hpp" +#include "geometry.hpp" + +#include +#include + + +namespace blank { + +class NullBounds +: public CollisionBounds { + +public: + NullBounds(); + + bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + +}; + + +class CuboidBounds +: public CollisionBounds { + +public: + CuboidBounds(const AABB &bounds); + + bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + +private: + AABB bb; + +}; + + +class StairBounds +: public CollisionBounds { + +public: + StairBounds(const AABB &bounds, const glm::vec2 &clip); + + bool Intersects(const Ray &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + bool Intersects(const glm::mat4 &, const AABB &, const glm::mat4 &, float &, glm::vec3 &) const noexcept override; + +private: + AABB top, bot; + +}; + +} + +#endif