Plane is represented by dot(N, X) = c, where N is a unit-length normal vector, c is the plane constant and X is any point on the plane. More...
#include <Nimble/Plane.hpp>
Public Member Functions | |
| float | distanceTo (const Nimble::Vector3f &point) const |
| Compute the signed distance to the plane. More... | |
| bool | intersect (const Nimble::Vector3f &rayO, const Nimble::Vector3f &rayD, float &rayT) const |
| Does a ray intersect the plane? More... | |
| Plane (const Nimble::Vector3f &normal, float constant) | |
| Constructs a new plance given the plane normal and the constant. | |
| Plane (const Nimble::Vector3f &normal, const Nimble::Vector3f &point) | |
| Constructs a new plance given the plane normal and a point on the plane. | |
Plane is represented by dot(N, X) = c, where N is a unit-length normal vector, c is the plane constant and X is any point on the plane.
User must ensure the normal vector satisfied this condition.
| float Nimble::Plane::distanceTo | ( | const Nimble::Vector3f & | point | ) | const |
Compute the signed distance to the plane.
Distance is positive if the point is on the positive side of the plane negative if vice-versa.
| point | point to test |
| bool Nimble::Plane::intersect | ( | const Nimble::Vector3f & | rayO, |
| const Nimble::Vector3f & | rayD, | ||
| float & | rayT | ||
| ) | const |
Does a ray intersect the plane?
| rayO | ray origin |
| rayD | unit-length ray direction vector |
| rayT | how far the intersection is from the ray origin |