![]() |
VR-Forces 4.1.1 Class Documentation
|
DtOsgIntersector is the OSG-specific implementation of the DtIntersector class. More...

Public Types | |
| typedef std::vector < DtOsgIntersectorResult > | DtOsgIntersections |
Public Types inherited from makVrv::DtIntersector | |
| enum | IntersectProperties { AllNodes = 0, PickableNodes = 1, SupportNodes = 2, NodesThatReceivesShadows = 4, NodesThatCastsShadows = 8 } |
| The IntersectProperties enum is a flag set that indicates the. More... | |
| typedef std::vector < DtIntersectorResult > | DtIntersections |
| A vector of DtIntersectionRecords. | |
Public Member Functions | |
| DtOsgIntersector (DtDe &de, int modelSet) | |
| CTOR. | |
| virtual | ~DtOsgIntersector () |
| DTOR. | |
| 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) |
| 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. | |
| 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) |
| Return a list of all intersections along the line passing through <x,y,z> and directed by <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. | |
| 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) |
| find first intersection along segment x,y,z to end_x, end_y, end_z. | |
| 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) |
| find all intersections along segment x,y,z to end_x, end_y, end_z. | |
| virtual bool | pick (DtChannel &channel, double mx, double my, DtIntersectorResult &intersection, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0) |
| Find the object (if any) under the mouse mx, my are in window coordinates. | |
| virtual bool | pickAll (DtChannel *channel, double mx, double my, DtIntersections &intersections, IntersectProperties properties=AllNodes, std::vector< DtElementID > *ignoreList=0) |
| Find all the objects (if any) under the mouse mx, my are in window coordinates. | |
| bool | findNearestIntersection (double x, double y, double z, double vx, double vy, double vz, DtOsgIntersectorResult &intersection, const DtOsgRenderer::RootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false, double maxIsectorLength=-1.0, bool useHighLod=false) |
| 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) | |
| bool | findIntersectionsThroughPoint (double x, double y, double z, double vx, double vy, double vz, DtOsgIntersector::DtOsgIntersections &intersections, const DtOsgRenderer::RootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false, double maxIsectorLength=-1.0, bool sort=true, bool useHighLod=false) |
| 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. | |
| bool | intersectLineSegmentWithScene (double x, double y, double z, double end_x, double end_y, double end_z, DtOsgIntersectorResult &intersection, const DtOsgRenderer::RootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false, bool useHighLod=false) |
| intersect the scene with a (directed) line segment and return the intersection closest to the initial (x,y,z) 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 | |
| bool | intersectLineSegmentWithScene (double x, double y, double z, double end_x, double end_y, double end_z, DtOsgIntersector::DtOsgIntersections &intersections, const DtOsgRenderer::RootList &intersectionRoots, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false, bool sort=true, bool useHighLod=false) |
| intersect the scene with a (directed) line segment 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 | |
| virtual bool | pick (osgViewer::View &view, double mx, double my, DtOsgIntersectorResult &intersection, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false) |
| returns the element id of the object under the mouse (mx, my) if one exists | |
| virtual bool | pick (osgViewer::View &view, double mx, double my, DtOsgIntersector::DtOsgIntersections &intersections, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, std::list< osg::Node * > *excludeNodeList=0, bool returnHitTriangle=false) |
| returns the element ids of the objects under the mouse (mx, my) if any exists | |
| void | getExcludeNodesFromIgnoreList (std::vector< DtUniqueID > *ignoreList, std::list< osg::Node * > &excludeNodes) |
Public Member Functions inherited from makVrv::DtIntersector | |
| DtIntersector (DtDe &de) | |
| CTOR. | |
| virtual | ~DtIntersector () |
| DTOR. | |
Static Public Member Functions | |
| static osg::Node::NodeMask | nodeMaskFromIntersectProperties (IntersectProperties properties) |
| static bool | anyNodeInNodePath (std::list< osg::Node * > *n, osg::NodePath const &path) |
Protected Member Functions | |
| osg::Vec3d | worldIntersectPoint (const osgUtil::Hit &hit) |
| Convert a Vec3 from local to world coordinates, maximizing precision. | |
| 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) |
| bool | fillResultFromHit (DtOsgIntersectorResult &result, const osgUtil::Hit &hit, bool returnHitTriangle) |
| bool | fillResultFromHit (DtOsgIntersectorResult &result, const osgUtil::LineSegmentIntersector::Intersection &hit, bool returnHitTriangle) |
| osgUtil::IntersectVisitor::HitList & | getLineSegmentIntersection (osgUtil::IntersectVisitor &collisionVisitor, double x, double y, double z, double end_x, double end_y, double end_z, const DtOsgRenderer::RootList &intersectionRoots, osg::Node::NodeMask mask) |
| Get the intersection of a line segment with the part of the sceneGraph under instersectRoot. | |
| bool | processLineSegmentIntersection (osgUtil::IntersectVisitor::HitList &hitList, std::list< osg::Node * > *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| returns the first intersection in the hitList (not necessarily the closest) | |
| bool | processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::IntersectVisitor::HitList &hitList, std::list< osg::Node * > *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| returns the intersection closest to the specified test point | |
| bool | processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::IntersectVisitor::HitList &hitList, std::list< osg::Node * > *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections, bool sort) |
| returns all intsersections in the hit list | |
| bool | processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, std::list< osg::Node * > *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) |
| returns the first pick in the hit list (closest? I think so) | |
| bool | processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, std::list< osg::Node * > *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections) |
| returns all the objects picked | |
Protected Attributes | |
| int | myModelSet |
Protected Attributes inherited from makVrv::DtIntersector | |
| DtDe & | myDe |
| CachedPick | myLastPick |
| bool | myLastPickSucceeded |
| DtIntersectorResult | myLastResult |
DtOsgIntersector is the OSG-specific implementation of the DtIntersector class.
It provides a variety of methods for finding intersections with the OSG scene graph.
| typedef std::vector<DtOsgIntersectorResult> makVrv::DtOsgIntersector::DtOsgIntersections |
| makVrv::DtOsgIntersector::DtOsgIntersector | ( | DtDe & | de, |
| int | modelSet | ||
| ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
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.
| false | if no intersection was found (and the isect record is NOT set). |
Implements makVrv::DtIntersector.
|
virtual |
Return a list of all intersections along the line passing through <x,y,z> and directed by <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.
| false | if no intersection was found (and the isect record list has size 0). |
Implements makVrv::DtIntersector.
|
virtual |
find first intersection along segment x,y,z to end_x, end_y, end_z.
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
| false | if no intersection was found (and the isect record is NOT set). |
Implements makVrv::DtIntersector.
|
virtual |
find all intersections along segment x,y,z to end_x, end_y, end_z.
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
| false | if no intersection was found (and the isect record list has size 0). |
Implements makVrv::DtIntersector.
|
virtual |
Find the object (if any) under the mouse mx, my are in window coordinates.
Object is defined as something with a DtUniqueID in it's userData field
| false | if no intersection was found (and the isect record is NOT set). |
Implements makVrv::DtIntersector.
|
virtual |
Find all the objects (if any) under the mouse mx, my are in window coordinates.
| false | if no intersection was found (and the isect record list has size 0). |
Implements makVrv::DtIntersector.
| bool makVrv::DtOsgIntersector::findNearestIntersection | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | vx, | ||
| double | vy, | ||
| double | vz, | ||
| DtOsgIntersectorResult & | intersection, | ||
| const DtOsgRenderer::RootList & | intersectionRoots, | ||
| osg::Node::NodeMask | mask = DtOsgNodeFlags::FlagAllOn, |
||
| std::list< osg::Node * > * | excludeNodeList = 0, |
||
| bool | returnHitTriangle = false, |
||
| double | maxIsectorLength = -1.0, |
||
| bool | useHighLod = false |
||
| ) |
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)
| false | if no intersection was found (and the intersectionResult is NOT set). Starts the intersection search from intersectionRoot(s). |
Will not intersect with excludeNode. 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.
| bool makVrv::DtOsgIntersector::findIntersectionsThroughPoint | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | vx, | ||
| double | vy, | ||
| double | vz, | ||
| DtOsgIntersector::DtOsgIntersections & | intersections, | ||
| const DtOsgRenderer::RootList & | intersectionRoots, | ||
| osg::Node::NodeMask | mask = DtOsgNodeFlags::FlagAllOn, |
||
| std::list< osg::Node * > * | excludeNodeList = 0, |
||
| bool | returnHitTriangle = false, |
||
| double | maxIsectorLength = -1.0, |
||
| bool | sort = true, |
||
| bool | useHighLod = false |
||
| ) |
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.
| bool makVrv::DtOsgIntersector::intersectLineSegmentWithScene | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | end_x, | ||
| double | end_y, | ||
| double | end_z, | ||
| DtOsgIntersectorResult & | intersection, | ||
| const DtOsgRenderer::RootList & | intersectionRoots, | ||
| osg::Node::NodeMask | mask = DtOsgNodeFlags::FlagAllOn, |
||
| std::list< osg::Node * > * | excludeNodeList = 0, |
||
| bool | returnHitTriangle = false, |
||
| bool | useHighLod = false |
||
| ) |
intersect the scene with a (directed) line segment and return the intersection closest to the initial (x,y,z) 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
| bool makVrv::DtOsgIntersector::intersectLineSegmentWithScene | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double | end_x, | ||
| double | end_y, | ||
| double | end_z, | ||
| DtOsgIntersector::DtOsgIntersections & | intersections, | ||
| const DtOsgRenderer::RootList & | intersectionRoots, | ||
| osg::Node::NodeMask | mask = DtOsgNodeFlags::FlagAllOn, |
||
| std::list< osg::Node * > * | excludeNodeList = 0, |
||
| bool | returnHitTriangle = false, |
||
| bool | sort = true, |
||
| bool | useHighLod = false |
||
| ) |
intersect the scene with a (directed) line segment 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
|
virtual |
returns the element id of the object under the mouse (mx, my) if one exists
|
virtual |
returns the element ids of the objects under the mouse (mx, my) if any exists
| void makVrv::DtOsgIntersector::getExcludeNodesFromIgnoreList | ( | std::vector< DtUniqueID > * | ignoreList, |
| std::list< osg::Node * > & | excludeNodes | ||
| ) |
|
static |
|
static |
|
protected |
Convert a Vec3 from local to world coordinates, maximizing precision.
Use these instead of getWorldIntersectPoint() and getWorldIntersectNormal
|
protected |
|
protected |
|
protected |
|
protected |
| Returns | true if an id is found, false otherwise |
|
protected |
| Returns | true if an id is found, false otherwise |
|
protected |
Get the intersection of a line segment with the part of the sceneGraph under instersectRoot.
|
protected |
returns the first intersection in the hitList (not necessarily the closest)
|
protected |
returns the intersection closest to the specified test point
|
protected |
returns all intsersections in the hit list
|
protected |
returns the first pick in the hit list (closest? I think so)
|
protected |
returns all the objects picked
|
protected |