X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry.hpp;fp=src%2Fgeometry.hpp;h=0000000000000000000000000000000000000000;hb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;hp=df75f22bf66720d31c6b4d4e0c08b83cb7fb312d;hpb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;p=blank.git diff --git a/src/geometry.hpp b/src/geometry.hpp deleted file mode 100644 index df75f22..0000000 --- a/src/geometry.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef BLANK_GEOMETRY_H_ -#define BLANK_GEOMETRY_H_ - -#include -#include - - -namespace blank { - -constexpr float PI = 3.141592653589793238462643383279502884; -constexpr float PI_0p25 = PI * 0.25f; -constexpr float PI_0p5 = PI * 0.5f; -constexpr float PI_1p5 = PI * 1.5f; -constexpr float PI_2p0 = PI * 2.0f; - -struct AABB { - glm::vec3 min; - glm::vec3 max; - - void Adjust() noexcept { - if (max.x < min.x) std::swap(max.x, min.x); - if (max.y < min.y) std::swap(max.y, min.y); - if (max.z < min.z) std::swap(max.z, min.z); - } -}; - -struct Ray { - glm::vec3 orig; - glm::vec3 dir; -}; - -bool Intersection( - const Ray &, - const AABB &, - const glm::mat4 &M, - float *dist = nullptr, - glm::vec3 *normal = nullptr) noexcept; - -bool CullTest(const AABB &box, const glm::mat4 &MVP) noexcept; - -} - -#endif