34
Plane::Plane(const vec3f & v1, const vec3f & v2, const vec3f & v3) {
35
vec3f edge1 = v1 - v2;
36
vec3f edge2 = v3 - v2;
34
Plane::Plane(const vec3 & v1, const vec3 & v2, const vec3 & v3) {
38
normal = edge2.cross(edge1);
38
normal = normalise(glm::cross(edge2, edge1));
43
d = -(normal.dot(point));
42
d = -(glm::dot(normal, point));
46
float Plane::distance(const vec3f & p) const{
47
return (d + normal.dot(p));
45
float Plane::distance(const vec3 & p) const{
46
return d + glm::dot(normal, p);