Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
|
#include <Plane.h>
Public Member Functions | |
Plane (const glm::vec3 &a, const glm::vec3 &b, const glm::vec3 &c) | |
Plane (const glm::vec3 &origin, const glm::vec3 &normal) | |
double | signedDistance (const glm::vec3 &p) const |
bool | isFrontFacingTo (const glm::vec3 &direction) const |
bool | lineIntersect (const glm::vec3 &linePoint, const glm::vec3 &lineDirection, glm::vec3 &intersection) |
Geometric object of a plane
Plane::Plane | ( | const glm::vec3 & | a, |
const glm::vec3 & | b, | ||
const glm::vec3 & | c | ||
) |
Creates a plane that contains the three points
Plane::Plane | ( | const glm::vec3 & | origin, |
const glm::vec3 & | normal | ||
) |
Creates a plane that contains origin
and is orthogonal to normal
bool Plane::isFrontFacingTo | ( | const glm::vec3 & | direction) | const |
Returns true iff direction
points in the opposite direction of the normal vector.
bool Plane::lineIntersect | ( | const glm::vec3 & | linePoint, |
const glm::vec3 & | lineDirection, | ||
glm::vec3 & | intersection | ||
) |
Returns false iff ´lineDirection´ is parallel to this plane, true otherwise. Returns the intersection point between this plane and the line described by the origin linePoint
and the direction lineDirection
.
[out] | intersection | intersection point between this plane ant the line |
double Plane::signedDistance | ( | const glm::vec3 & | p) | const |
Returns the distance between this plane and p, positive is the normal vector points in the direction of p
, negative otherwise