51 if (&cv==
this)
return *
this;
100 unsigned int numActivePlanes = 0;
103 PlaneList::const_iterator itr;
108 if (resultMask&selector_mask) ++numActivePlanes;
115 unsigned int index = 0;
120 if (resultMask&selector_mask)
123 _planeList[index++].transformProvidingInverse(matrix);
140 for(PlaneList::iterator itr=
_planeList.begin();
200 unsigned int selector_mask = 0x1;
201 for(PlaneList::const_iterator itr=
_planeList.begin();
205 if ((
_maskStack.back()&selector_mask) && (itr->distance(v)<0.0f))
return false;
212 inline bool contains(
const std::vector<Vec3>& vertices)
218 for(std::vector<Vec3>::const_iterator vitr = vertices.begin();
219 vitr != vertices.end();
223 bool outside =
false;
225 for(PlaneList::const_iterator itr=
_planeList.begin();
229 if ((
_maskStack.back()&selector_mask) && (itr->distance(v)<0.0f)) outside =
true;
233 if (!outside)
return true;
250 for(PlaneList::const_iterator itr=
_planeList.begin();
256 int res=itr->intersect(bs);
257 if (res<0)
return false;
277 for(PlaneList::const_iterator itr=
_planeList.begin();
283 int res=itr->intersect(bb);
284 if (res<0)
return false;
300 for(PlaneList::const_iterator itr=
_planeList.begin();
306 int res=itr->intersect(vertices);
307 if (res<1)
return false;
323 for(PlaneList::const_iterator itr=
_planeList.begin();
329 int res=itr->intersect(bs);
330 if (res<1)
return false;
346 for(PlaneList::const_iterator itr=
_planeList.begin();
352 int res=itr->intersect(bb);
353 if (res<1)
return false;
386 for(PlaneList::iterator itr=
_planeList.begin();
392 itr->transformProvidingInverse(matrix);
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
BoundingBoxd BoundingBox
Definition BoundingBox:257
BoundingSphered BoundingSphere
Definition BoundingSphere:308
Matrixd Matrix
Definition Matrix:27
value_type & xMax()
Definition BoundingBox:116
value_type & yMin()
Definition BoundingBox:110
value_type & xMin()
Definition BoundingBox:107
value_type & zMin()
Definition BoundingBox:113
value_type & zMax()
Definition BoundingBox:122
value_type & yMax()
Definition BoundingBox:119
Simple stack implementation that keeps the back() cached locally for fast access rather than at the b...
Definition fast_back_stack:31
T & back()
Definition fast_back_stack:54
bool invert(const Matrixd &rhs)
invert the matrix rhs, automatically select invert_4x3 or invert_4x4.
Definition Matrixd:233
A plane class.
Definition Plane:34
bool containsAllOf(const osg::BoundingSphere &bs)
Check whether the entire bounding sphere is contained within clipping set.
Definition Polytope:316
ClippingMask _resultMask
Definition Polytope:402
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.
ClippingMask getResultMask() const
Definition Polytope:178
void setReferenceVertexList(VertexList &vertices)
Definition Polytope:155
const VertexList & getReferenceVertexList() const
Definition Polytope:159
void pushCurrentMask()
Definition Polytope:185
void set(const PlaneList &pl)
Definition Polytope:132
Polytope()
Definition Polytope:35
bool contains(const osg::Vec3 &v) const
Check whether a vertex is contained within clipping set.
Definition Polytope:196
PlaneList & getPlaneList()
Definition Polytope:150
Polytope(const PlaneList &pl)
Definition Polytope:43
MaskStack & getMaskStack()
Definition Polytope:180
~Polytope()
Definition Polytope:45
void setAndTransformProvidingInverse(const Polytope &pt, const osg::Matrix &matrix)
Definition Polytope:85
bool contains(const osg::BoundingSphere &bs)
Check whether any part of a bounding sphere is contained within clipping set.
Definition Polytope:243
bool contains(const std::vector< Vec3 > &vertices)
Check whether any part of vertex list is contained within clipping set.
Definition Polytope:212
unsigned int ClippingMask
Definition Polytope:30
void setupMask()
Definition Polytope:162
void setResultMask(ClippingMask mask)
Definition Polytope:176
void add(const osg::Plane &pl)
Definition Polytope:135
PlaneList _planeList
Definition Polytope:403
MaskStack _maskStack
Definition Polytope:401
ClippingMask getCurrentMask() const
Definition Polytope:174
bool contains(const osg::BoundingBox &bb)
Check whether any part of a bounding box is contained within clipping set.
Definition Polytope:270
void popCurrentMask()
Definition Polytope:190
void setToBoundingBox(const BoundingBox &bb)
Create a Polytope which is a equivalent to BoundingBox.
Definition Polytope:73
void flip()
flip/reverse the orientation of all the planes.
Definition Polytope:138
bool containsAllOf(const std::vector< Vec3 > &vertices)
Check whether all of vertex list is contained with clipping set.
Definition Polytope:293
VertexList _referenceVertexList
Definition Polytope:404
void clear()
Definition Polytope:47
void transform(const osg::Matrix &matrix)
Transform the clipping set by matrix.
Definition Polytope:371
std::vector< Vec3 > VertexList
Definition Polytope:32
Polytope(const Polytope &cv)
Definition Polytope:37
VertexList & getReferenceVertexList()
Definition Polytope:157
void transformProvidingInverse(const osg::Matrix &matrix)
Transform the clipping set by provide a pre inverted matrix.
Definition Polytope:380
bool containsAllOf(const osg::BoundingBox &bb)
Check whether the entire bounding box is contained within clipping set.
Definition Polytope:339
std::vector< Plane > PlaneList
Definition Polytope:31
const MaskStack & getMaskStack() const
Definition Polytope:182
fast_back_stack< ClippingMask > MaskStack
Definition Polytope:33
const PlaneList & getPlaneList() const
Definition Polytope:152
ClippingMask & getCurrentMask()
Definition Polytope:172
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.
Definition Polytope:60
bool empty() const
Definition Polytope:148
General purpose float triple for use as vertices, vectors and normals.
Definition Vec3f:29
#define OSG_EXPORT
Definition Export:39