|
3es
0.7
|
Plane geometry functions. More...
Enumerations | |
| enum | PlaneClassification { PC_Behind = -1, PC_On = 0, PC_InFront = 1 } |
| Point classification results. More... | |
Functions | |
| template<typename T > | |
| Vector4< T > | create (const Vector3< T > &normal, T distance) |
| Create a plane from a normal and distance (D) value. More... | |
| template<typename T > | |
| Vector4< T > | fromNormalAndPoint (const Vector3< T > &normal, const Vector3< T > &pointOnPlane) |
| Create a plane from a normal and a point on the plane. More... | |
| template<typename T > | |
| T | signedDistanceToPoint (const Vector4< T > &plane, const Vector3< T > &point) |
Calculate the signed distance between the plane and point. More... | |
| template<typename T > | |
| Vector3< T > | projectPoint (const Vector4< T > &plane, const Vector3< T > &point) |
Project a point onto a plane. More... | |
| template<typename T > | |
| int | classifyPoint (const Vector4< T > &plane, const Vector3< T > &point, T epsilon=0) |
Classify a point with respect to a plane (see PlaneClassification). More... | |
Plane geometry functions.
A plane is defined by a Vector4 where the xyz components are the normal and the w component is the plane distance.
|
inline |
Classify a point with respect to a plane (see PlaneClassification).
| plane | The plane equation. |
| point | The point of interest. |
| epsilon | Epsilon value used as a tolerance for PC_On results. |
PlaneClassification. References PC_Behind, PC_InFront, PC_On, and signedDistanceToPoint().
|
inline |
Create a plane from a normal and distance (D) value.
| normal | The plane normal. Must be normalised. |
| distance | the plane D component. |
| Vector4<T> tes::planegeom::fromNormalAndPoint | ( | const Vector3< T > & | normal, |
| const Vector3< T > & | pointOnPlane | ||
| ) |
Create a plane from a normal and a point on the plane.
| normal | The plane normal. Must be normalised. |
| pointOnPlane | An arbitrary point on the plane. |
References tes::Vector3< T >::dot().
|
inline |
Project a point onto a plane.
| plane | The plane equation. |
| point | The point of interest. |
point. References signedDistanceToPoint(), and tes::Vector4< T >::xyz().
|
inline |
Calculate the signed distance between the plane and point.
Positive is in front, negative behind and zero on.
| plane | The plane equation. |
| point | The point of interest. |
point to the plane (signed). References tes::Vector4< T >::xyz().
Referenced by classifyPoint(), and projectPoint().