18 #include <osgUtil/IntersectVisitor>
21 #include <osgUtil/LineSegmentIntersector>
47 double normalY,
double normalZ,
const DtUniqueID&
id,
48 std::vector<osg::Vec3> triangle, osg::Matrixd localToWorld );
92 virtual bool findNearestIntersectionToPoint(
double x,
double y,
double z,
93 double vx,
double vy,
double vz,
96 std::vector<DtElementID>* ignoreList=0,
97 bool returnTriangle=
false,
98 double maxIsectorLength=-1.,
bool useHighLod=
false );
107 virtual bool findAllIntersectionsThroughPoint(
double x,
double y,
double z,
110 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
118 virtual bool findFirstIntersectWithLineSegment(
119 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
122 std::vector<DtElementID>* ignoreList=0,
bool useHighLod=
false);
130 virtual bool findAllIntersectWithLineSegment(
131 double x,
double y,
double z,
double end_x,
double end_y,
double end_z,
134 std::vector<DtElementID>* ignoreList=0,
bool sort=
true,
bool useHighLod=
false );
141 virtual bool pick(
DtChannel& channel,
double mx,
double my,
144 std::vector<DtElementID>* ignoreList=0);
150 virtual bool pickAll(
DtChannel* channel,
double mx,
double my,
152 std::vector<DtElementID>* ignoreList=0);
180 bool findNearestIntersection(
double x,
double y,
double z,
184 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
185 double maxIsectorLength=-1.0,
bool useHighLod=
false);
200 bool findIntersectionsThroughPoint(
double x,
double y,
double z,
201 double vx,
double vy,
double vz,
205 std::list<osg::Node*>* excludeNodeList=0,
bool returnHitTriangle=
false,
206 double maxIsectorLength=-1.0,
bool sort=
true,
bool useHighLod=
false );
213 bool intersectLineSegmentWithScene(
double x,
double y,
double z,
214 double end_x,
double end_y,
double end_z,
218 std::list<osg::Node*>* excludeNodeList=0,
219 bool returnHitTriangle=
false,
bool useHighLod=
false );
226 bool intersectLineSegmentWithScene(
double x,
double y,
double z,
227 double end_x,
double end_y,
double end_z,
231 std::list<osg::Node*>* excludeNodeList=0,
232 bool returnHitTriangle=
false,
bool sort=
true,
bool useHighLod=
false );
236 virtual bool pick( osgViewer::View& view,
double mx,
double my,
239 std::list<osg::Node*>* excludeNodeList=0,
240 bool returnHitTriangle=
false );
244 virtual bool pick( osgViewer::View& view,
double mx,
double my,
247 std::list<osg::Node*>* excludeNodeList=0,
248 bool returnHitTriangle=
false );
250 void getExcludeNodesFromIgnoreList( std::vector<DtUniqueID>* ignoreList,
251 std::list<osg::Node*>& excludeNodes );
255 static osg::Node::NodeMask nodeMaskFromIntersectProperties(
258 static bool anyNodeInNodePath(std::list<osg::Node*>* n,
259 osg::NodePath
const& path);
265 osg::Vec3d worldIntersectPoint(
const osgUtil::Hit& hit );
267 osg::Vec3d worldIntersectPoint(
268 const osgUtil::LineSegmentIntersector::Intersection& hit );
270 osg::Vec3d localToWorld(
const osg::Vec3& local,
const osg::Matrix& localToWorld );
272 bool findIdFromNodePath(
const osg::NodePath& nodePath,
DtUniqueID&
id );
276 bool returnHitTriangle ) ;
280 const osgUtil::LineSegmentIntersector::Intersection& hit,
281 bool returnHitTriangle ) ;
285 osgUtil::IntersectVisitor::HitList& getLineSegmentIntersection(
286 osgUtil::IntersectVisitor& collisionVisitor,
double x,
double y,
double z,
287 double end_x,
double end_y,
double end_z,
291 bool processLineSegmentIntersection(
292 osgUtil::IntersectVisitor::HitList& hitList,
293 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
297 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
298 osgUtil::IntersectVisitor::HitList& hitList,
299 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
303 bool processLineSegmentIntersection(
const osg::Vec3d& testPoint,
304 osgUtil::IntersectVisitor::HitList& hitList,
305 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
309 bool processPickIntersection(
310 osgUtil::LineSegmentIntersector::Intersections& hitList,
311 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
315 bool processPickIntersection(
316 osgUtil::LineSegmentIntersector::Intersections& hitList,
317 std::list<osg::Node*>* excludeNodeList,
bool returnHitTriangle,
338 return diffA.length2() > diffB.length2();