Visual Computing Library
|
The Plane class represent a 2D plane in 3D space. More...
#include <vclib/space/core/plane.h>
Public Types | |
using | ScalarType = Scalar |
using | PointType = Point3< Scalar > |
Public Member Functions | |
Plane () | |
Empty constructor. The plane is uninitialized. | |
Plane (const Point3< Scalar > &direction, Scalar offset) | |
Constructor of a plane given a direction and an offset. | |
Plane (const Point3< Scalar > &p0, const Point3< Scalar > &normal) | |
Constructor of a plane given a point lying to the plane and the normal of the plane. | |
Plane (const Point3< Scalar > &p0, const Point3< Scalar > &p1, const Point3< Scalar > &p2) | |
Constructor of a plane given three points. | |
template<typename S > | |
auto | cast () const |
const Point3< Scalar > & | direction () const |
Returns the direction component of the plane. | |
Scalar | offset () const |
Returns the offset component of the plane. | |
Point3< Scalar > | projectPoint (const Point3< Scalar > &p) const |
Given a point, returns the point projected to this plane. | |
Point3< Scalar > | mirrorPoint (const Point3< Scalar > &p) const |
Given a point, returns the point mirrored w.r.t. this plane. | |
bool | operator== (const Plane &p) const |
bool | operator!= (const Plane &p) const |
Private Attributes | |
Point3< Scalar > | mDir |
Scalar | mOffset |
The Plane class represent a 2D plane in 3D space.
This is the class for infinite planes in 3D space. A Plane is stored just as a Point3 and a scalar:
Just to be clear, given a point p on a plane it always holds: plane.direction().dot(p) == plane.offset()
A vcl::Plane, once initialized, cannot be changed.
|
inline |
Constructor of a plane given a direction and an offset.
direction | |
offset |
|
inline |
Constructor of a plane given a point lying to the plane and the normal of the plane.
p0 | |
normal |
|
inline |
Constructor of a plane given three points.
p0 | |
p1 | |
p2 |
|
inline |
Returns the direction component of the plane.
|
inline |
Given a point, returns the point mirrored w.r.t. this plane.
p |
|
inline |
Returns the offset component of the plane.
|
inline |
Given a point, returns the point projected to this plane.
p |