This class represents a plane in three-dimensional space. More...
#include "Plane3.hpp"
Public Member Functions | |
Plane3T () | |
The default constructor. More... | |
Plane3T (const Vector3T< T > &Normal_, T Dist_) | |
An explicit constructor. More... | |
Plane3T (const Vector3T< T > &A, const Vector3T< T > &B, const Vector3T< T > &C, const T Epsilon) | |
This constructor creates the plane that contains the points ABC in clockwise order. More... | |
bool | IsValid () const |
Returns true if the plane is valid, that is, if the normal vector is valid and (roughly) has length 1. More... | |
void | GetSpanVectors (Vector3T< T > &U, Vector3T< T > &V) const |
Compute two orthogonal span vectors for this plane. More... | |
void | GetSpanVectorsByRotation (Vector3T< T > &U, Vector3T< T > &V) const |
Compute two orthogonal span vectors for this plane, using a different method than GetSpanVectors(). More... | |
Plane3T | GetMirror () const |
Returns the same, but mirrored plane, i.e. the plane with the reversed orientation. More... | |
T | GetDistance (const Vector3T< T > &A) const |
Determines the distance from A to this plane. More... | |
Vector3T< T > | GetIntersection (const Vector3T< T > &A, const Vector3T< T > &B, const T cosEpsilon) const |
Intersect the line through A and B with this plane. More... | |
bool | operator== (const Plane3T &P) const |
Returns whether this plane and plane P are truly (bit-wise) identical. More... | |
bool | operator!= (const Plane3T &P) const |
Returns whether this plane and plane P are not equal (bit-wise). More... | |
Static Public Member Functions | |
static Vector3T< T > | GetIntersection (const Plane3T &P1, const Plane3T &P2, const Plane3T &P3) |
Builds the intersection of three planes. More... | |
static void | ConvexHull (const ArrayT< Vector3T< T > > &Points, ArrayT< Plane3T > &HullPlanes, ArrayT< unsigned long > *HullPlanesPIs, const T Epsilon) |
Computes the convex hull of a set of points. More... | |
Public Attributes | |
Vector3T< T > | Normal |
Normal vector of this plane. More... | |
T | Dist |
Distance to origin (0, 0, 0). More... | |
This class represents a plane in three-dimensional space.
Eigenschaften der Ebene (Vereinbarungen):
An explicit constructor.
|
inline |
This constructor creates the plane that contains the points ABC in clockwise order.
The normal vector then points towards the observer (orientation!).
A | First point. |
B | Second point. |
C | Third point. |
Epsilon | Tolerance value. |
DivisionByZeroE | if cross(C-A, B-A) yields a vector shorter than Epsilon. |
|
static |
Computes the convex hull of a set of points.
Points | The set of points for which the convex hull is computed. |
HullPlanes | The array in which the convex hull planes are returned. |
HullPlanesPIs | If non-NULL, in this array are triples of indices into Points returned, where the i-th triple indicates from which points the i-th hull plane was built. |
Epsilon | In order to fight rounding errors, the "thickness" of a hull plane is assumed to be 2*Epsilon. |
Determines the distance from A to this plane.
|
inline |
Intersect the line through A and B with this plane.
A | First point of the line. |
B | Second point of the line. |
cosEpsilon | If the angle between the planes normal vector and AB is too close to 90 degrees, AB roughly parallels the plane. The cosine of this angle is then close to 0. This value defines the minimally allowed cosine for which AB is considered not paralleling the plane. |
DivisionByZeroE | if AB parallels the plane too much. |
|
inlinestatic |
Builds the intersection of three planes.
P1 | First plane. |
P2 | Second plane. |
P3 | Third plane. |
DivisionByZeroE | if the intersection of the three planes has not exactly one solution. |
Returns the same, but mirrored plane, i.e. the plane with the reversed orientation.
|
inline |
Compute two orthogonal span vectors for this plane.
|
inline |
Compute two orthogonal span vectors for this plane, using a different method than GetSpanVectors().
U | First span vector. |
V | Second span vector. TODO: Is this method more robust than GetSpanVectors()? See the implementation of GetSpanVectors() to understand the problem. That is, does this method not produce very different span vectors for very similar planes in some rare cases? If I understand atan2() correctly, it's two parameters refer to the Gegenkathete and Ankathete of an orthogonal triangle. Thus, atan2() should be able to operate smoothly even if one of its arguments is zero or near-zero. This seems to imply the smoothness of its results, and thus the robustness of this method, which solves the problem. But what if they are both zero? Does atan2() then yield an error? Or 0? Is its behaviour then consistent across platforms? |
|
inline |
Returns true if the plane is valid, that is, if the normal vector is valid and (roughly) has length 1.
Returns whether this plane and plane P are not equal (bit-wise).
Use this operator with care, as it comes without any epsilon threshold for taking rounding errors into account.
P | Plane to compare to. |
Returns whether this plane and plane P are truly (bit-wise) identical.
Use this operator with care, as it comes without any epsilon threshold for taking rounding errors into account.
P | Plane to compare to. |
T Plane3T< T >::Dist |
Distance to origin (0, 0, 0).