X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgeometry.hpp;h=d74e08e6b6fc8c29a5bc104ce381d6f0632e6289;hb=753be639d7d04f9f7415db9fc2721485c531f0a1;hp=e8ead98de83bc75b1b32481cca16673371c966b3;hpb=4d0ef1687987a0801469c7262f81efd36636605a;p=blank.git diff --git a/src/geometry.hpp b/src/geometry.hpp index e8ead98..d74e08e 100644 --- a/src/geometry.hpp +++ b/src/geometry.hpp @@ -7,6 +7,8 @@ namespace blank { +constexpr float PI = 3.141592653589793238462643383279502884; + struct AABB { glm::vec3 min; glm::vec3 max; @@ -23,7 +25,12 @@ struct Ray { glm::vec3 dir; }; -bool Intersection(const Ray &, const AABB &, const glm::mat4 &M, float *dist = nullptr); +bool Intersection( + const Ray &, + const AABB &, + const glm::mat4 &M, + float *dist = nullptr, + glm::vec3 *normal = nullptr); }