1 #ifndef BLANK_MODEL_GEOMETRY_H_
2 #define BLANK_MODEL_GEOMETRY_H_
10 constexpr float PI = 3.141592653589793238462643383279502884;
11 constexpr float PI_0p25 = PI * 0.25f;
12 constexpr float PI_0p5 = PI * 0.5f;
13 constexpr float PI_1p5 = PI * 1.5f;
14 constexpr float PI_2p0 = PI * 2.0f;
20 void Adjust() noexcept {
21 if (max.x < min.x) std::swap(max.x, min.x);
22 if (max.y < min.y) std::swap(max.y, min.y);
23 if (max.z < min.z) std::swap(max.z, min.z);
26 glm::vec3 Center() const noexcept {
27 return min + (max - min) * 0.5f;
40 float *dist = nullptr,
41 glm::vec3 *normal = nullptr) noexcept;
49 glm::vec3 &normal) noexcept;
51 bool CullTest(const AABB &box, const glm::mat4 &MVP) noexcept;