14#ifndef OSGUTIL_POLYTOPEINTERSECTOR
15#define OSGUTIL_POLYTOPEINTERSECTOR 1
54 numIntersectionPoints(0),
59 if (distance < rhs.
distance)
return true;
60 if (rhs.
distance < distance)
return false;
63 if (nodePath < rhs.
nodePath)
return true;
64 if (rhs.
nodePath < nodePath )
return false;
68 enum { MaxNumIntesectionPoints=6 };
77 Vec3_type intersectionPoints[MaxNumIntesectionPoints];
92 POINT_PRIMITIVES = (1<<0),
93 LINE_PRIMITIVES = (1<<1),
94 TRIANGLE_PRIMITIVES = (1<<2),
95 ALL_PRIMITIVES = ( POINT_PRIMITIVES | LINE_PRIMITIVES | TRIANGLE_PRIMITIVES )
113#ifdef OSG_USE_DEPRECATED_API
115 DimZero = POINT_PRIMITIVES,
116 DimOne = LINE_PRIMITIVES,
117 DimTwo = TRIANGLE_PRIMITIVES,
118 AllDims = ALL_PRIMITIVES
122 inline void setDimensionMask(
unsigned int mask) { setPrimitiveMask(mask); }
125 inline unsigned int getDimensionMask()
const {
return getPrimitiveMask(); }
Definition IntersectionVisitor:152
Definition IntersectionVisitor:34
CoordinateFrame
Definition IntersectionVisitor:38
Definition PolytopeIntersector:25
osg::Plane _referencePlane
plane to use for sorting intersections
Definition PolytopeIntersector:149
PolytopeIntersector(CoordinateFrame cf, double xMin, double yMin, double xMax, double yMax)
virtual bool enter(const osg::Node &node)
std::set< Intersection > Intersections
Definition PolytopeIntersector:81
void setPrimitiveMask(unsigned int mask)
Definition PolytopeIntersector:99
PolytopeIntersector(const osg::Polytope &polytope)
unsigned int _primitiveMask
mask which dimensions should be checked
Definition PolytopeIntersector:148
osg::Plane::Vec3_type Vec3_type
Definition PolytopeIntersector:47
void setReferencePlane(const osg::Plane &plane)
Definition PolytopeIntersector:109
unsigned int getPrimitiveMask() const
Definition PolytopeIntersector:102
const osg::Polytope & getPolytope() const
Definition PolytopeIntersector:44
Intersection getFirstIntersection()
Definition PolytopeIntersector:87
Intersections _intersections
Definition PolytopeIntersector:151
const osg::Plane & getReferencePlane() const
Definition PolytopeIntersector:111
PolytopeIntersector * _parent
Definition PolytopeIntersector:144
osg::Polytope _polytope
Definition PolytopeIntersector:146
virtual bool containsIntersections()
Definition PolytopeIntersector:140
void insertIntersection(const Intersection &intersection)
Definition PolytopeIntersector:83
PolytopeIntersector(CoordinateFrame cf, const osg::Polytope &polytope)
virtual void intersect(osgUtil::IntersectionVisitor &iv, osg::Drawable *drawable)
osg::Polytope & getPolytope()
Definition PolytopeIntersector:41
Intersections & getIntersections()
Definition PolytopeIntersector:85
virtual Intersector * clone(osgUtil::IntersectionVisitor &iv)
A plane class. It can be used to represent an infinite plane.
Definition Plane:34
Shader generator framework.
Definition NodeVisitor:25
std::vector< Node * > NodePath
Definition Node:47
#define OSGUTIL_EXPORT
Definition osgUtil/Export:40
Definition PolytopeIntersector:50
Vec3_type localIntersectionPoint
center of all intersection points
Definition PolytopeIntersector:75
osg::ref_ptr< osg::RefMatrix > matrix
Definition PolytopeIntersector:74
unsigned int numIntersectionPoints
Definition PolytopeIntersector:76
unsigned int primitiveIndex
primitive index
Definition PolytopeIntersector:78
double distance
distance from reference plane
Definition PolytopeIntersector:70
osg::NodePath nodePath
Definition PolytopeIntersector:72
double maxDistance
maximum distance of intersection points from reference plane
Definition PolytopeIntersector:71
osg::ref_ptr< osg::Drawable > drawable
Definition PolytopeIntersector:73
Intersection()
Definition PolytopeIntersector:51