#include <OSGPlane.h>
Collaboration diagram for osg::Plane:

Public Methods | |
Constructor | |
| Plane (void) | |
| Default Constructor. | |
| Plane (const Plane &obj) | |
| Copy Constructor. | |
| Plane (const Pnt3f &p0, const Pnt3f &p1, const Pnt3f &p2) | |
| Construct a plane given 3 points. | |
| Plane (const Vec3f &n, Real32 d) | |
| Construct a plane given normal and distance from origin along normal. | |
| Plane (const Vec3f &n, const Pnt3f &p) | |
| Construct a plane given normal and a point to pass through Orientation is given by the normal vector n. | |
Offset | |
| void | offset (Real32 d) |
| Offset a plane by a given distance. | |
Intersection | |
| bool | intersect (const Plane &pl, Line &intersection) const |
| Intersect plane and plane, returning true if there is an intersection false if planes are parallel taken from Steve Baker's SG library, used with permission. | |
| bool | intersect (const Line &l, Pnt3f &intersection) const |
| Intersect line and plane, returning true if there is an intersection in the positive part of the line false if line is parallel to plane. | |
| bool | intersect (const Line &l, Real32 &t) const |
| Intersect line and plane, returning true if there is an intersection false if line is parallel to plane. | |
| bool | intersectInfinite (const Line &l, Real32 &t) const |
| Intersect line and plane, returning true if there is an intersection false if line is parallel to plane. | |
| bool | intersectInfinite (const Line &l, Pnt3f &intersection) const |
| Intersect line and plane, returning true if there is an intersection false if line is parallel to plane. | |
| void | transform (const Matrix &matrix) |
| Transforms the plane by the given matrix. | |
| bool | isInHalfSpace (const Pnt3f &point) const |
| bool | isOnPlane (const Pnt3f &point) const |
| Returns true if the given point is on the plane. | |
| Real32 | distance (const Pnt3f &point) const |
Set Values | |
| void | set (const Vec3f &normal, Real32 distance) |
| void | set (Real32 x, Real32 y, Real32 z, Real32 distance) |
| void | set (const Vec4f &plane) |
Access | |
| const Vec3f & | getNormal (void) const |
| Real32 | getDistanceFromOrigin (void) const |
Private Attributes | |
| Vec3f | _normalVec |
| Real32 | _distance |
Friends | |
Comparison | |
| OSG_BASE_DLLMAPPING friend bool | operator== (const Plane &p1, const Plane &p2) |
| Equality comparison operators. | |
| OSG_BASE_DLLMAPPING friend bool | operator!= (const Plane &p1, const Plane &p2) |
The plane is defined by a plane normal and a distance from the origin along that normal Planes may be used to represent either planes or half-spaces. In the latter case (as for the isInHalfSpace() method), the half-space is defined to be all points on the plane or on the side of the plane in the direction of the plane normal.
The 4 coefficients of the plane equation of an Plane can be obtained easily as the 3 coordinates of the plane normal and the distance, in that order. The normal is normalized.
node: Plane is all p such that normalVec . p - distance = 0
|
|
Default Constructor.
|
|
|
Copy Constructor.
|
|
||||||||||||||||
|
Construct a plane given 3 points. Orientation is computed by taking (p1 - p0) x (p2 - p0) and pointing the normal in that direction. |
|
||||||||||||
|
Construct a plane given normal and distance from origin along normal. Orientation is given by the normal vector n. |
|
||||||||||||
|
Construct a plane given normal and a point to pass through Orientation is given by the normal vector n.
|
|
|
Offset a plane by a given distance.
|
|
||||||||||||
|
Intersect plane and plane, returning true if there is an intersection false if planes are parallel taken from Steve Baker's SG library, used with permission. Algorithm explanation can be found at http://geometryalgorithms.com/Archive/algorithm_0104/algorithm_0104.htm |
|
||||||||||||
|
Intersect line and plane, returning true if there is an intersection in the positive part of the line false if line is parallel to plane.
|
|
||||||||||||
|
Intersect line and plane, returning true if there is an intersection false if line is parallel to plane. t is the distance along the line. |
|
||||||||||||
|
Intersect line and plane, returning true if there is an intersection false if line is parallel to plane. t is the distance along the line, which may be negative, i.e. the check is against a double infinite line. |
|
||||||||||||
|
Intersect line and plane, returning true if there is an intersection false if line is parallel to plane.
|
|
|
Transforms the plane by the given matrix.
|
|
|
Returns true if the given point is within the half-space defined by the plane |
|
|
Returns true if the given point is on the plane.
|
|
|
Get the distance of the point from the plane. |
|
||||||||||||
|
Set the plane given the normal and distance. The normal needs to be normalized! |
|
||||||||||||||||||||
|
Set the plane given the (x,y,z) normal and distance The normal needs to be normalized! |
|
|
Set the plane given the (x,y,z) normal and distance in a Vec4f The normal needs to be normalized! |
|
|
Get the normal vector. |
|
|
Get the distance from the origin. |
|
||||||||||||
|
Equality comparison operators.
|
|
||||||||||||
|
!= operator, based on ==. |
|
|
|
|
|
|
1.2.16