OpenSceneGraph 3.6.5
|
A Polytope class for representing convex clipping volumes made up of a set of planes. More...
#include <Polytope>
Public Types | |
typedef unsigned int | ClippingMask |
typedef std::vector< Plane > | PlaneList |
typedef std::vector< Vec3 > | VertexList |
typedef fast_back_stack< ClippingMask > | MaskStack |
Public Member Functions | |
Polytope () | |
Polytope (const Polytope &cv) | |
Polytope (const PlaneList &pl) | |
~Polytope () | |
void | clear () |
Polytope & | operator= (const Polytope &cv) |
void | setToUnitFrustum (bool withNear=true, bool withFar=true) |
Create a Polytope which is a cube, centered at 0,0,0, with sides of 2 units. | |
void | setToBoundingBox (const BoundingBox &bb) |
Create a Polytope which is a equivalent to BoundingBox. | |
void | setAndTransformProvidingInverse (const Polytope &pt, const osg::Matrix &matrix) |
void | set (const PlaneList &pl) |
void | add (const osg::Plane &pl) |
void | flip () |
flip/reverse the orientation of all the planes. | |
bool | empty () const |
PlaneList & | getPlaneList () |
const PlaneList & | getPlaneList () const |
void | setReferenceVertexList (VertexList &vertices) |
VertexList & | getReferenceVertexList () |
const VertexList & | getReferenceVertexList () const |
void | setupMask () |
ClippingMask & | getCurrentMask () |
ClippingMask | getCurrentMask () const |
void | setResultMask (ClippingMask mask) |
ClippingMask | getResultMask () const |
MaskStack & | getMaskStack () |
const MaskStack & | getMaskStack () const |
void | pushCurrentMask () |
void | popCurrentMask () |
bool | contains (const osg::Vec3 &v) const |
Check whether a vertex is contained within clipping set. | |
bool | contains (const std::vector< Vec3 > &vertices) |
Check whether any part of vertex list is contained within clipping set. | |
bool | contains (const osg::BoundingSphere &bs) |
Check whether any part of a bounding sphere is contained within clipping set. | |
bool | contains (const osg::BoundingBox &bb) |
Check whether any part of a bounding box is contained within clipping set. | |
bool | containsAllOf (const std::vector< Vec3 > &vertices) |
Check whether all of vertex list is contained with clipping set. | |
bool | containsAllOf (const osg::BoundingSphere &bs) |
Check whether the entire bounding sphere is contained within clipping set. | |
bool | containsAllOf (const osg::BoundingBox &bb) |
Check whether the entire bounding box is contained within clipping set. | |
bool | contains (const osg::Vec3f &v0, const osg::Vec3f &v1, const osg::Vec3f &v2) const |
Check whether any part of a triangle is contained within the polytope. | |
void | transform (const osg::Matrix &matrix) |
Transform the clipping set by matrix. | |
void | transformProvidingInverse (const osg::Matrix &matrix) |
Transform the clipping set by provide a pre inverted matrix. |
Protected Attributes | |
MaskStack | _maskStack |
ClippingMask | _resultMask |
PlaneList | _planeList |
VertexList | _referenceVertexList |
A Polytope class for representing convex clipping volumes made up of a set of planes.
When adding planes, their normals should point inwards (into the volume)
typedef unsigned int osg::Polytope::ClippingMask |
typedef std::vector<Plane> osg::Polytope::PlaneList |
typedef std::vector<Vec3> osg::Polytope::VertexList |
|
inline |
References setupMask().
Referenced by operator=(), Polytope(), and setAndTransformProvidingInverse().
|
inline |
References _maskStack, _planeList, _referenceVertexList, _resultMask, and Polytope().
|
inline |
References _planeList, and setupMask().
|
inline |
|
inline |
References _planeList, and setupMask().
|
inline |
References _planeList, and setupMask().
|
inline |
Check whether any part of a bounding box is contained within clipping set.
Using a mask to determine which planes should be used for the check, and modifying the mask to turn off planes which wouldn't contribute to clipping of any internal objects. This feature is used in osgUtil::CullVisitor to prevent redundant plane checking.
References _maskStack, _planeList, and _resultMask.
|
inline |
Check whether any part of a bounding sphere is contained within clipping set.
Using a mask to determine which planes should be used for the check, and modifying the mask to turn off planes which wouldn't contribute to clipping of any internal objects. This feature is used in osgUtil::CullVisitor to prevent redundant plane checking.
References _maskStack, _planeList, and _resultMask.
|
inline |
Check whether a vertex is contained within clipping set.
References _maskStack, and _planeList.
bool osg::Polytope::contains | ( | const osg::Vec3f & | v0, |
const osg::Vec3f & | v1, | ||
const osg::Vec3f & | v2 ) const |
Check whether any part of a triangle is contained within the polytope.
|
inline |
Check whether any part of vertex list is contained within clipping set.
References _maskStack, _planeList, and _resultMask.
|
inline |
Check whether the entire bounding box is contained within clipping set.
References _maskStack, _planeList, and _resultMask.
|
inline |
Check whether the entire bounding sphere is contained within clipping set.
References _maskStack, _planeList, and _resultMask.
|
inline |
Check whether all of vertex list is contained with clipping set.
References _maskStack, _planeList, and _resultMask.
|
inline |
References _planeList.
|
inline |
flip/reverse the orientation of all the planes.
References _planeList.
|
inline |
References _maskStack.
|
inline |
References _maskStack.
|
inline |
References _maskStack.
|
inline |
References _maskStack.
|
inline |
References _planeList.
Referenced by osgUtil::CullVisitor::MatrixPlanesDrawables::set().
|
inline |
References _planeList.
|
inline |
References _referenceVertexList.
|
inline |
References _referenceVertexList.
|
inline |
References _resultMask.
Referenced by osgUtil::CullVisitor::MatrixPlanesDrawables::set().
References _maskStack, _planeList, _referenceVertexList, _resultMask, and Polytope().
|
inline |
References _maskStack.
|
inline |
References _maskStack, and _resultMask.
|
inline |
References _planeList, and setupMask().
|
inline |
References _maskStack, _planeList, _referenceVertexList, _resultMask, osg::fast_back_stack< T >::back(), and Polytope().
|
inline |
References _referenceVertexList.
|
inline |
References _resultMask.
|
inline |
Create a Polytope which is a equivalent to BoundingBox.
References _planeList, setupMask(), osg::BoundingBoxImpl< VT >::xMax(), osg::BoundingBoxImpl< VT >::xMin(), osg::BoundingBoxImpl< VT >::yMax(), osg::BoundingBoxImpl< VT >::yMin(), osg::BoundingBoxImpl< VT >::zMax(), and osg::BoundingBoxImpl< VT >::zMin().
|
inline |
Create a Polytope which is a cube, centered at 0,0,0, with sides of 2 units.
References _planeList, and setupMask().
|
inline |
References _maskStack, _planeList, and _resultMask.
Referenced by add(), clear(), Polytope(), Polytope(), set(), setToBoundingBox(), and setToUnitFrustum().
|
inline |
Transform the clipping set by matrix.
Note, this operations carries out the calculation of the inverse of the matrix since a plane must be multiplied by the inverse transposed to transform it. This makes 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 clipping set by provide a pre inverted matrix.
see transform for details.
References _maskStack, _planeList, and _resultMask.
Referenced by transform().
|
protected |
Referenced by contains(), contains(), contains(), contains(), containsAllOf(), containsAllOf(), containsAllOf(), getCurrentMask(), getCurrentMask(), getMaskStack(), getMaskStack(), operator=(), Polytope(), popCurrentMask(), pushCurrentMask(), setAndTransformProvidingInverse(), setupMask(), and transformProvidingInverse().
|
protected |
Referenced by add(), clear(), contains(), contains(), contains(), contains(), containsAllOf(), containsAllOf(), containsAllOf(), empty(), flip(), getPlaneList(), getPlaneList(), operator=(), Polytope(), Polytope(), set(), setAndTransformProvidingInverse(), setToBoundingBox(), setToUnitFrustum(), setupMask(), and transformProvidingInverse().
|
protected |
|
protected |
![]() | Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0. |