DtOsgIntersector is the OSG-specific implementation of the DtIntersector class. It provides a variety of methods for finding intersections with the OSG scene graph.
|
| | DtOsgIntersector (DtDe &de, int modelSet) |
| |
| virtual | ~DtOsgIntersector () |
| |
| | DtOsgIntersector ()=delete |
| |
| | DtOsgIntersector (const DtOsgIntersector &rhs)=delete |
| |
| DtOsgIntersector & | operator= (const DtOsgIntersector &rhs)=delete |
| |
| virtual bool | findNearestIntersectionToPoint (double x, double y, double z, double vx, double vy, double vz, DtIntersectorResult &intersection, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0, bool returnTriangle=false, double maxIsectorLength=-1., bool useHighLod=false) override |
| |
| virtual bool | findAllIntersectionsThroughPoint (double x, double y, double z, double vx, double vy, double vz, DtIntersections &intersections, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0, bool sort=true, bool useHighLod=false) override |
| |
| virtual bool | findFirstIntersectWithLineSegment (double x, double y, double z, double end_x, double end_y, double end_z, DtIntersectorResult &intersection, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0, bool useHighLod=false) override |
| |
| virtual bool | findAllIntersectWithLineSegment (double x, double y, double z, double end_x, double end_y, double end_z, DtIntersections &intersections, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0, bool sort=true, bool useHighLod=false) override |
| |
| virtual bool | pick (DtChannel &channel, double mx, double my, DtIntersectorResult &intersection, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0) override |
| |
| virtual bool | pickAll (DtChannel *channel, double mx, double my, DtIntersections &intersections, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0) override |
| |
| virtual bool | findNearestIntersection (double x, double y, double z, double vx, double vy, double vz, DtOsgIntersectorResult &intersection, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *excludeNodeList=0, bool returnHitTriangle=false, double maxIsectorLength=-1.0, bool useHighLod=false) |
| |
| virtual bool | findIntersectionsThroughPoint (double x, double y, double z, double vx, double vy, double vz, DtOsgIntersector::DtOsgIntersections &intersections, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *exclusions=0, bool returnHitTriangle=false, double maxIsectorLength=-1.0, bool sort=true, bool useHighLod=false) |
| |
| virtual bool | intersectLineSegmentWithScene (double x, double y, double z, double end_x, double end_y, double end_z, DtOsgIntersectorResult &intersection, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *excludeNodeList=0, bool returnHitTriangle=false, bool useHighLod=false) |
| |
| virtual bool | intersectLineSegmentWithScene (double x, double y, double z, double end_x, double end_y, double end_z, DtOsgIntersector::DtOsgIntersections &intersections, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *excludeNodeList=0, bool returnHitTriangle=false, bool sort=true, bool useHighLod=false) |
| |
| virtual bool | pick (const osgViewer::View &view, double mx, double my, DtOsgIntersectorResult &intersection, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *excludeNodeList=0, bool returnHitTriangle=false) |
| |
| virtual bool | pick (const osgViewer::View &view, double mx, double my, DtOsgIntersector::DtOsgIntersections &intersections, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *excludeNodeList=0, bool returnHitTriangle=false) |
| |
| | DtIntersector (DtDe &de, int modelSet) |
| |
| virtual | ~DtIntersector () |
| |
| virtual void | setDynamicOceanProperties (DynamicOceanProperties properties) |
| |
| DynamicOceanProperties | dynamicOceanProperties () const |
| |
| virtual int | modelSet (void) const |
| |
| virtual void | setDefaultMaxClamp (double maximumIsectorLength) |
| |
| virtual double | defaultMaxClamp () const |
| |
|
| virtual float | distanceToResult2 (double x, double y, double z, DtOsgIntersectorResult &result) |
| |
| virtual bool | calcEndpointsFromDirectionAndLength (double x, double y, double z, double vx, double vy, double vz, double length, const DtSceneRootList &intersectionRoots, DtVector &startPoint, DtVector &endPoint) const |
| |
| virtual void | calculateStartEnd (DtVector &start, DtVector &end, const osgViewer::View &view, double mx, double my) const |
| |
| virtual void | calculateStartEnd (DtVector &start, DtVector &end, const osg::Camera *osgCamera, double mx, double my) const |
| |
| virtual const osg::Camera * | getActiveCamera (const osgViewer::View &view) const |
| |
| void | getExcludeNodesFromIgnoreList (std::vector< DtUniqueID > *ignoreList, DtOsgItersectorExclusions &exclusions) |
| |
| osg::Vec3d | worldIntersectPoint (const osgUtil::Hit &hit) |
| |
| osg::Vec3d | worldIntersectPoint (const osgUtil::LineSegmentIntersector::Intersection &hit) |
| |
| osg::Vec3d | localToWorld (const osg::Vec3 &local, const osg::Matrix &localToWorld) |
| |
| bool | findIdFromNodePath (const osg::NodePath &nodePath, DtUniqueID &id) |
| |
| void | updateInstanceIntersectElementId (DtOsgIntersectorResult &result) |
| |
| bool | fillResultFromHit (DtOsgIntersectorResult &result, const osgUtil::LineSegmentIntersector::Intersection &hit, bool returnHitTriangle) |
| |
| void | doLineSegmentIntersections (osgUtil::IntersectionVisitor &collisionVisitor, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask) |
| |
| bool | processLineSegmentIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| |
| bool | processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| |
| bool | processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections, bool sort) |
| |
| bool | processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| |
| bool | processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections) |
| |
| void | setupCollisionVisitor (bool useHighLod, DtOsgIntersectionVisitor &visitor) |
| |
| bool | shouldInstanceIntersect (osg::Node::NodeMask nodeMask) |
| |
Note that even with intersection debug drawing enabled, these OSG-specific functions do not result in any debug drawing. You can request intersection drawing explicitly for your intersection call with:
if ( myDe.sharedState().intersectorDrawEnabled() ) { DtIntersectorManager::instance( myDe ).drawIntersection( intersection, myDe.sharedState().intersectorDrawnDuration() ); }
Of course, users don't need the 'if' and can supply any draw duration desired
| virtual bool makVrv::DtOsgIntersector::findNearestIntersectionToPoint |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
double |
vx, |
|
|
double |
vy, |
|
|
double |
vz, |
|
|
DtIntersectorResult & |
intersection, |
|
|
IntersectProperties |
properties = AllNodes, |
|
|
std::vector< DtElementID > * |
ignoreList = 0, |
|
|
bool |
returnTriangle = false, |
|
|
double |
maxIsectorLength = -1., |
|
|
bool |
useHighLod = false |
|
) |
| |
|
overridevirtual |
Find the nearest scene intersection from a point (x,y,z) along a vector(vx,vy,vz) The useHighLod argument tells the intersector that if the terrain is an osgEarth terrain, don't settle for whatever is paged in; get the highest LOD from the map server for this location and use that Note that if maxIsectorLength is not set, the default is the diameter of the database, which for large (and especially geocentric) databases and world databases, may be too large to get adequate precision when trying to interect small (high resolution) triangles. It is recommended that you set the isector length to something more specific if possible, like the altitude of the observer + a constant, for example; or, for osgEarth databases, useHighLod=true, which will also eliminate the problem.
- Return values
-
| false | if no intersection was found (and the isect record is NOT set). |
Implements makVrv::DtIntersector.
| virtual bool makVrv::DtOsgIntersector::findNearestIntersection |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
double |
vx, |
|
|
double |
vy, |
|
|
double |
vz, |
|
|
DtOsgIntersectorResult & |
intersection, |
|
|
const DtSceneRootList & |
intersectionRoots, |
|
|
osg::Node::NodeMask |
mask = DtOsgNodeFlags::FlagAllOn, |
|
|
DtOsgItersectorExclusions * |
excludeNodeList = 0, |
|
|
bool |
returnHitTriangle = false, |
|
|
double |
maxIsectorLength = -1.0, |
|
|
bool |
useHighLod = false |
|
) |
| |
|
virtual |
Find the nearest intersection from a point (x,y,z) along a vector(vx,vy,vz) stored in a collision point (cx,cy,cz) with normal (normal_x, normal_y, normal_z)
- Return values
-
| false | if no intersection was found (and the intersectionResult is NOT set). Starts the intersection search from intersectionRoot(s). |
Will not intersect with DtOsgItersectorExclusions. Will constrain the Isector used to the specified length if > 0.0 The useHighLod argument tells the intersector that if the terrain is an osgEarth terrain, don't settle for whatever is paged in; get the highest LOD from the map server for this location and use that Note that if maxIsectorLength is not set, the default is the diameter of the database, which for large (and especially geocentric) databases and world databases, may be too large to get adequate precision when trying to interect small (high resolution) triangles. It is recommended that you set the isector length to something more specific if possible, like the altitude of the observer + a constant, for example; or, for osgEarth databases, useHighLod=true, which will also eliminate the problem.
Reimplemented in makVrv::DtTritonIntersector.
| virtual bool makVrv::DtOsgIntersector::findIntersectionsThroughPoint |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z, |
|
|
double |
vx, |
|
|
double |
vy, |
|
|
double |
vz, |
|
|
DtOsgIntersector::DtOsgIntersections & |
intersections, |
|
|
const DtSceneRootList & |
intersectionRoots, |
|
|
osg::Node::NodeMask |
mask = DtOsgNodeFlags::FlagAllOn, |
|
|
DtOsgItersectorExclusions * |
exclusions = 0, |
|
|
bool |
returnHitTriangle = false, |
|
|
double |
maxIsectorLength = -1.0, |
|
|
bool |
sort = true, |
|
|
bool |
useHighLod = false |
|
) |
| |
|
virtual |
intersect the scene with a line segment going through (x,y,z), directed by <vx, vy,vz>, and large enough to cover the entire sceneGraph, and return all intersections The useHighLod argument tells the intersector that if the terrain is an osgEarth terrain, don't settle for whatever is paged in; get the highest LOD from the map server for this location and use that Note that if maxIsectorLength is not set, the default is the diameter of the database, which for large (and especially geocentric) databases and world databases, may be too large to get adequate precision when trying to interect small (high resolution) triangles. It is recommended that you set the isector length to something more specific if possible, like the altitude of the observer + a constant, for example; or, for osgEarth databases, useHighLod=true, which will also eliminate the problem.
Reimplemented in makVrv::DtTritonIntersector.