#include <plane3.h>
Public Types | |
typedef Point3< T > | PointType |
typedef T | ScalarType |
Public Member Functions | |
Constructors | |
Plane3 () | |
The empty constructor. | |
Plane3 (const ScalarType &dist, const PointType &dir) | |
The (distance, direction) constructor. | |
template<class Q > | |
void | Import (const Plane3< Q, false > &b) |
Members to access the distance or direction | |
Direction() cannot be assigned directly. Use SetDirection() or Set() instead. This is mandatory to make possible the automatic autonormalization template mechanism. Note that if you have to set both direction and offset it can be more efficient to set them toghether | |
const ScalarType & | Offset () const |
ScalarType & | Offset () |
void | SetOffset (const ScalarType &o) |
sets the origin | |
const PointType & | Direction () const |
void | SetDirection (const PointType &dir) |
sets the direction | |
void | Set (const ScalarType &off, const PointType &dir) |
sets origin and direction. | |
void | Set (const PointType &dir, const ScalarType &off) |
bool | operator== (Plane3 const &p) const |
Operator to compare two lines. | |
bool | operator!= (Plane3 const &p) const |
Operator to dispare two lines. | |
PointType | Projection (const PointType &p) const |
Project a point on the plane. | |
PointType | Mirror (const PointType &p) const |
Mirror the point wrt the plane. | |
void | Normalize () |
Function to normalize direction. | |
void | Init (const PointType &p0, const PointType &p1, const PointType &p2) |
Calculates the plane passing through three points (Rename this method) | |
void | Init (const PointType &p0, const PointType &norm) |
Calculates the plane passing through a point and the normal (Rename this method. | |
Private Attributes | |
PointType | _dir |
Direction (not necessarily normalized unless NORM is true) | |
ScalarType | _offset |
Distance. |
Templated class for 2D planes in 3D spaces. This is the class for infinite planes in 3D space. A Plane is stored just as a Point3 and a scalar: a direction (not necessarily normalized), an offset from the origin
Just to be clear, given a point P on a plane it always holds:
plane.Direction().dot(P) == plane.Offset()
T | (template parameter) Specifies the type of scalar used to represent coords. |
NORM,: | if on, the direction is always Normalized |