OpenSceneGraph 3.6.5
|
A plane class. More...
#include <Plane>
Public Types | |
enum | { num_components = 3 } |
Number of vector components. More... | |
typedef double | value_type |
Type of Plane class. | |
typedef Vec3d | Vec3_type |
typedef Vec4d | Vec4_type |
Public Member Functions | |
Plane () | |
Default constructor. | |
Plane (const Plane &pl) | |
Plane (value_type a, value_type b, value_type c, value_type d) | |
Constructor. | |
Plane (const Vec4f &vec) | |
Constructor. | |
Plane (const Vec4d &vec) | |
Constructor. | |
Plane (const Vec3_type &norm, value_type d) | |
Constructor. | |
Plane (const Vec3_type &v1, const Vec3_type &v2, const Vec3_type &v3) | |
Constructor. | |
Plane (const Vec3_type &norm, const Vec3_type &point) | |
Constructor. | |
Plane & | operator= (const Plane &pl) |
void | set (const Plane &pl) |
void | set (value_type a, value_type b, value_type c, value_type d) |
void | set (const Vec4f &vec) |
void | set (const Vec4d &vec) |
void | set (const Vec3_type &norm, double d) |
void | set (const Vec3_type &v1, const Vec3_type &v2, const Vec3_type &v3) |
void | set (const Vec3_type &norm, const Vec3_type &point) |
void | flip () |
flip/reverse the orientation of the plane. | |
void | makeUnitLength () |
This method multiplies the coefficients of the plane equation with a constant factor so that the equation a^2+b^2+c^2 = 1 holds. | |
void | calculateUpperLowerBBCorners () |
calculate the upper and lower bounding box corners to be used in the intersect(BoundingBox&) method for speeding calculations. | |
bool | valid () const |
Checks if all internal values describing the plane have valid numbers. | |
bool | isNaN () const |
bool | operator== (const Plane &plane) const |
bool | operator!= (const Plane &plane) const |
bool | operator< (const Plane &plane) const |
A plane is said to be smaller than another plane if the first non-identical element of the internal array is smaller than the corresponding element of the other plane. | |
value_type * | ptr () |
const value_type * | ptr () const |
Vec4_type | asVec4 () const |
value_type & | operator[] (unsigned int i) |
value_type | operator[] (unsigned int i) const |
Vec3_type | getNormal () const |
float | distance (const osg::Vec3f &v) const |
Calculate the distance between a point and the plane. | |
double | distance (const osg::Vec3d &v) const |
Calculate the distance between a point and the plane. | |
float | dotProductNormal (const osg::Vec3f &v) const |
calculate the dot product of the plane normal and a point. | |
double | dotProductNormal (const osg::Vec3d &v) const |
calculate the dot product of the plane normal and a point. | |
int | intersect (const std::vector< Vec3f > &vertices) const |
intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane. | |
int | intersect (const std::vector< Vec3d > &vertices) const |
intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane. | |
int | intersect (const BoundingSphere &bs) const |
intersection test between plane and bounding sphere. | |
int | intersect (const BoundingBox &bb) const |
intersection test between plane and bounding sphere. | |
void | transform (const osg::Matrix &matrix) |
Transform the plane by matrix. | |
void | transformProvidingInverse (const osg::Matrix &matrix) |
Transform the plane by providing a pre inverted matrix. |
Protected Attributes | |
value_type | _fv [4] |
Vec member variable. | |
unsigned int | _upperBBCorner |
unsigned int | _lowerBBCorner |
A plane class.
It can be used to represent an infinite plane.
The infinite plane is described by an implicit plane equation a*x+b*y+c*z+d = 0. Though it is not mandatory that a^2+b^2+c^2 = 1 is fulfilled in general some methods require it (
typedef double osg::Plane::value_type |
Type of Plane class.
typedef Vec3d osg::Plane::Vec3_type |
typedef Vec4d osg::Plane::Vec4_type |
|
inline |
Default constructor.
The default constructor initializes all values to zero.
References _fv, _lowerBBCorner, and _upperBBCorner.
Referenced by osg::InfinitePlane::InfinitePlane(), operator!=(), operator<(), operator=(), operator==(), Plane(), and set().
|
inline |
Constructor.
The plane is described as a*x+b*y+c*z+d = 0.
References set().
|
inline |
Constructor.
The plane can also be described as vec*[x,y,z,1].
References set().
|
inline |
Constructor.
The plane can also be described as vec*[x,y,z,1].
References set().
|
inline |
Constructor.
This constructor initializes the internal values directly without any checking or manipulation.
norm | The normal of the plane. |
d | The negative distance from the point of origin to the plane. |
References set().
Constructor.
This constructor calculates from the three points describing an infinite plane the internal values.
References set().
Constructor.
This constructor initializes the internal values directly without any checking or manipulation.
norm | The normal of the plane. |
point | A point of the plane. |
References set().
|
inline |
calculate the upper and lower bounding box corners to be used in the intersect(BoundingBox&) method for speeding calculations.
References _fv, _lowerBBCorner, and _upperBBCorner.
|
inline |
Calculate the distance between a point and the plane.
References _fv, osg::Vec3d::x(), osg::Vec3d::y(), and osg::Vec3d::z().
|
inline |
Calculate the distance between a point and the plane.
References _fv, osg::Vec3f::x(), osg::Vec3f::y(), and osg::Vec3f::z().
Referenced by intersect(), intersect(), intersect(), and intersect().
|
inline |
calculate the dot product of the plane normal and a point.
References _fv, osg::Vec3d::x(), osg::Vec3d::y(), and osg::Vec3d::z().
|
inline |
calculate the dot product of the plane normal and a point.
References _fv, osg::Vec3f::x(), osg::Vec3f::y(), and osg::Vec3f::z().
|
inline |
flip/reverse the orientation of the plane.
References _fv, and calculateUpperLowerBBCorners().
|
inline |
intersection test between plane and bounding sphere.
return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.
References _lowerBBCorner, _upperBBCorner, osg::BoundingBoxImpl< VT >::corner(), and distance().
|
inline |
intersection test between plane and bounding sphere.
return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.
References osg::BoundingSphereImpl< VT >::center(), distance(), and osg::BoundingSphereImpl< VT >::radius().
|
inline |
intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.
References distance().
|
inline |
intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.
References distance().
|
inline |
References _fv, and osg::isNaN().
Referenced by valid().
|
inline |
This method multiplies the coefficients of the plane equation with a constant factor so that the equation a^2+b^2+c^2 = 1 holds.
References _fv.
Referenced by transformProvidingInverse().
|
inline |
|
inline |
References _fv.
|
inline |
References _fv.
|
inline |
References _fv.
|
inline |
References _fv.
|
inline |
References _fv, calculateUpperLowerBBCorners(), and Plane().
Referenced by osgParticle::DomainOperator::addDiskDomain(), osgParticle::DomainOperator::addPlaneDomain(), osgParticle::DomainOperator::addRectangleDomain(), osgParticle::DomainOperator::addTriangleDomain(), operator=(), Plane(), Plane(), Plane(), Plane(), Plane(), Plane(), Plane(), set(), set(), and transformProvidingInverse().
|
inline |
References osg::Vec3d::length(), set(), and osg::Vec3d::set().
|
inline |
References _fv, and calculateUpperLowerBBCorners().
|
inline |
Transform the plane by matrix.
Note, this operation carries out the calculation of the inverse of the matrix since a plane must be multiplied by the inverse transposed to transform it. This make this operation expensive. If the inverse has been already calculated elsewhere then use transformProvidingInverse() instead. See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf
References osg::Matrixd::invert(), and transformProvidingInverse().
|
inline |
Transform the plane by providing a pre inverted matrix.
see transform for details.
References _fv, makeUnitLength(), and set().
Referenced by transform().
|
inline |
Checks if all internal values describing the plane have valid numbers.
References isNaN().
|
protected |
Vec member variable.
Referenced by asVec4(), calculateUpperLowerBBCorners(), distance(), distance(), dotProductNormal(), dotProductNormal(), flip(), getNormal(), isNaN(), makeUnitLength(), operator!=(), operator<(), operator==(), operator[](), operator[](), Plane(), ptr(), ptr(), set(), set(), and transformProvidingInverse().
|
protected |
Referenced by calculateUpperLowerBBCorners(), intersect(), and Plane().
|
protected |
Referenced by calculateUpperLowerBBCorners(), intersect(), and Plane().
![]() | Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0. |