18 #include <glm/glm.hpp>
22 Plane(
const glm::vec3 &v1,
const glm::vec3 &v2,
const glm::vec3 &v3) { set3Points(v1, v2, v3); }
23 Plane(
const glm::vec3 &normal,
const glm::vec3 &point) { setNormalAndPoint(normal, point); }
24 Plane(
float a,
float b,
float c,
float d) { setCoefficients(a, b, c, d); }
25 Plane() : _normal(0.0f), _point(0.0f), _dCoefficient(0.0f) {};
29 void set3Points(
const glm::vec3 &v1,
const glm::vec3 &v2,
const glm::vec3 &v3);
30 void setNormalAndPoint(
const glm::vec3 &normal,
const glm::vec3 &point);
31 void setCoefficients(
float a,
float b,
float c,
float d);
34 const glm::vec3& getNormal()
const {
return _normal; };
35 const glm::vec3& getPoint()
const {
return _point; };
36 float getDCoefficient()
const {
return _dCoefficient; };
39 void invalidate() { _normal = glm::vec3(0.0f), _dCoefficient = 1.0e6f; }
40 float distance(
const glm::vec3 &point)
const;