VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtTritonIntersector Class Reference

DtTritonIntersector works with the methods in the DtOsgIntersector class to provide a Triton-aware implementation of DtIntersector. It overrides the methods necessary for adding intersections with the Triton dynamic ocean.

Inheritance diagram for makVrv::DtTritonIntersector:
Inheritance graph
[legend]

Public Member Functions

 DtTritonIntersector (DtDe &de, DtModelSetId modelSet)
 
virtual ~DtTritonIntersector ()
 
 DtTritonIntersector ()=delete
 
 DtTritonIntersector (const DtTritonIntersector &rhs)=delete
 
DtTritonIntersector & operator= (const DtTritonIntersector &rhs)=delete
 
virtual bool findNearestIntersection (double x, double y, double z, double vx, double vy, double vz, DtOsgIntersectorResult &intersection, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask, DtOsgItersectorExclusions *exclusions, bool returnHitTriangle, double maxIsectorLength, bool useHighLod) const override
 
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, DtOsgItersectorExclusions *exclusions, bool returnHitTriangle, double maxIsectorLength, bool sort, bool useHighLod) const override
 
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 *exclusions=0, bool returnHitTriangle=false, bool useHighLod=false) const override
 
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 *exclusions=0, bool returnHitTriangle=false, bool sort=true, bool useHighLod=false) const override
 
virtual bool pick (const osgViewer::View &view, double mx, double my, DtOsgIntersectorResult &intersection, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *exclusions=0, bool returnHitTriangle=false) override
 
virtual bool pick (const osgViewer::View &view, double mx, double my, DtOsgIntersector::DtOsgIntersections &intersections, osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn, DtOsgItersectorExclusions *exclusions=0, bool returnHitTriangle=false) override
 
- Public Member Functions inherited from makVrv::DtOsgIntersector
 DtOsgIntersector (DtDe &de, DtModelSetId 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) const 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) const 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) const 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) const 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
 
- Public Member Functions inherited from makVrv::DtIntersector
 DtIntersector (DtDe &de, DtModelSetId modelSet)
 
virtual ~DtIntersector ()
 
virtual void setDynamicOceanProperties (DynamicOceanProperties properties)
 
virtual void slot_setDynamicOceanProperties (int type, bool onOff)
 
virtual DynamicOceanProperties dynamicOceanProperties () const
 
virtual DtModelSetId modelSet (void) const
 
virtual void setDefaultMaxClamp (double maximumIsectorLength)
 
virtual double defaultMaxClamp () const
 

Protected Member Functions

virtual bool doOceanPick (const DtVector &start, const DtVector &end, DtVector &oceanIntersectLocation, DtVector &oceanIntersectNormal, DtVector *nearPlanePosition=0) const
 
virtual bool pickTritonWaves (const DtVector &start, const DtVector &end, DtVector &result, DtVector &normal, DtVector *nearPlanePosition=0) const
 
virtual bool pickTritonSeaLevel (const DtVector &start, const DtVector &end, DtVector &result, DtVector &normal, DtVector *nearPlanePosition=0) const
 
virtual bool doOceanIntersect (const DtVector &start, const DtVector &end, DtVector &oceanIntersectLocation, DtVector &oceanIntersectNormal) const
 
virtual bool intersectTritonWaves (const DtVector &start, const DtVector &dir, DtVector &result, DtVector &normal) const
 
virtual bool intersectTritonSeaLevel (const DtVector &start, const DtVector &dir, DtVector &seaPlane, DtVector &normal) const
 
virtual bool intersectionBelowSeaLevel (const DtIntersectorResult &intersection) const
 
virtual bool addOceanIntersectIfCloser (const DtVector &start, const DtVector &end, bool intersectionHasResult, DtOsgIntersectorResult &intersection) const
 
virtual void fillOceanIntersection (const DtVector &oceanIntersectLocation, const DtVector &oceanIntersectNormal, DtIntersectorResult &intersection) const
 
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 transformSeaLevelForTritonManager (DtVector &seaLevel) const
 
virtual void slot_coordinateSystemChanged ()
 
- Protected Member Functions inherited from makVrv::DtOsgIntersector
virtual float distanceToResult2 (double x, double y, double z, DtOsgIntersectorResult &result) 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) const
 
osg::Vec3d worldIntersectPoint (const osgUtil::Hit &hit) const
 
osg::Vec3d worldIntersectPoint (const osgUtil::LineSegmentIntersector::Intersection &hit) const
 
osg::Vec3d localToWorld (const osg::Vec3 &local, const osg::Matrix &localToWorld) const
 
bool findIdFromNodePath (const osg::NodePath &nodePath, DtUniqueID &id) const
 
void updateInstanceIntersectElementId (DtOsgIntersectorResult &result) const
 
bool fillResultFromHit (DtOsgIntersectorResult &result, const osgUtil::LineSegmentIntersector::Intersection &hit, bool returnHitTriangle) const
 
void doLineSegmentIntersections (osgUtil::IntersectionVisitor &collisionVisitor, const DtSceneRootList &intersectionRoots, osg::Node::NodeMask mask) const
 
bool processLineSegmentIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) const
 
bool processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) const
 
bool processLineSegmentIntersection (const osg::Vec3d &testPoint, osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections, bool sort) const
 
bool processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersectorResult &intersection) const
 
bool processPickIntersection (osgUtil::LineSegmentIntersector::Intersections &hitList, DtOsgItersectorExclusions *excludeNodeList, bool returnHitTriangle, DtOsgIntersector::DtOsgIntersections &intersections) const
 
void setupCollisionVisitor (bool useHighLod, DtOsgIntersectionVisitor &visitor) const
 
bool shouldInstanceIntersect (osg::Node::NodeMask nodeMask) const
 

Protected Attributes

const DtDynamicOceanObjectManager & myDynamicOceanObjectManager
 
DtSignalConnectionManager myConnections
 
DtCoordinateConverter * myCoordinateConverter = nullptr
 
DtTritonManager & myTritonManager
 
- Protected Attributes inherited from makVrv::DtIntersector
DtDe & myDe
 
DynamicOceanProperties myDynamicOceanProperties
 
CachedPick myLastPick
 
bool myLastPickSucceeded
 
DtIntersectorResult myLastResult
 
double myDefaultMaxClamp
 
const DtModelSetId myModelSet
 
DtSignalConnectionManager myConnections
 

Additional Inherited Members

- Public Types inherited from makVrv::DtOsgIntersector
typedef std::vector
< DtOsgIntersectorResult > 
DtOsgIntersections
 
- Public Types inherited from makVrv::DtIntersector
enum  IntersectProperties {
  AllNodes = 0, PickableNodes = 1, SupportNodes = 2, NodesThatReceivesShadows = 4,
  NodesThatCastsShadows = 8, OsgEarthTerrainSkin = 16, TerrainPatchInsetNotOsgEarth = 32
}
 
enum  DynamicOceanProperties { DynamicOceanPropertyMsl = 0, DynamicOceanPropertyWaves = 1, DynamicOceanPropertyIgnore = 2 }
 
typedef std::vector
< DtIntersectorResult > 
DtIntersections
 
- Static Public Member Functions inherited from makVrv::DtOsgIntersector
static osg::Node::NodeMask nodeMaskFromIntersectProperties (IntersectProperties properties)
 
static bool anyNodeInNodePath (std::list< osg::Node * > *n, osg::NodePath const &path)
 

Constructor & Destructor Documentation

makVrv::DtTritonIntersector::DtTritonIntersector ( DtDe &  de,
DtModelSetId  modelSet 
)

CTOR.

virtual makVrv::DtTritonIntersector::~DtTritonIntersector ( )
virtual

DTOR.

makVrv::DtTritonIntersector::DtTritonIntersector ( )
delete

default constructor - not allowed

makVrv::DtTritonIntersector::DtTritonIntersector ( const DtTritonIntersector &  rhs)
delete

copy constructor - not allowed

Member Function Documentation

DtTritonIntersector& makVrv::DtTritonIntersector::operator= ( const DtTritonIntersector &  rhs)
delete

assignment operator - not allowed

virtual bool makVrv::DtTritonIntersector::findNearestIntersection ( double  x,
double  y,
double  z,
double  vx,
double  vy,
double  vz,
DtOsgIntersectorResult &  intersection,
const DtSceneRootList &  intersectionRoots,
osg::Node::NodeMask  mask,
DtOsgItersectorExclusions *  exclusions,
bool  returnHitTriangle,
double  maxIsectorLength,
bool  useHighLod 
) const
overridevirtual

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
falseif 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.

Reimplemented from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::findIntersectionsThroughPoint ( double  x,
double  y,
double  z,
double  vx,
double  vy,
double  vz,
DtOsgIntersector::DtOsgIntersections &  intersections,
const DtSceneRootList &  intersectionRoots,
osg::Node::NodeMask  mask,
DtOsgItersectorExclusions *  exclusions,
bool  returnHitTriangle,
double  maxIsectorLength,
bool  sort,
bool  useHighLod 
) const
overridevirtual

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 from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::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 *  exclusions = 0,
bool  returnHitTriangle = false,
bool  useHighLod = false 
) const
overridevirtual

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

Reimplemented from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::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 *  exclusions = 0,
bool  returnHitTriangle = false,
bool  sort = true,
bool  useHighLod = false 
) const
overridevirtual

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

Reimplemented from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::pick ( const osgViewer::View &  view,
double  mx,
double  my,
DtOsgIntersectorResult &  intersection,
osg::Node::NodeMask  mask = DtOsgNodeFlags::FlagAllOn,
DtOsgItersectorExclusions *  exclusions = 0,
bool  returnHitTriangle = false 
)
overridevirtual

returns the element id of the object under the mouse (mx, my) if one exists

Reimplemented from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::pick ( const osgViewer::View &  view,
double  mx,
double  my,
DtOsgIntersector::DtOsgIntersections &  intersections,
osg::Node::NodeMask  mask = DtOsgNodeFlags::FlagAllOn,
DtOsgItersectorExclusions *  exclusions = 0,
bool  returnHitTriangle = false 
)
overridevirtual

returns the element ids of the objects under the mouse (mx, my) if any exists

Reimplemented from makVrv::DtOsgIntersector.

virtual bool makVrv::DtTritonIntersector::doOceanPick ( const DtVector &  start,
const DtVector &  end,
DtVector &  oceanIntersectLocation,
DtVector &  oceanIntersectNormal,
DtVector *  nearPlanePosition = 0 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::pickTritonWaves ( const DtVector &  start,
const DtVector &  end,
DtVector &  result,
DtVector &  normal,
DtVector *  nearPlanePosition = 0 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::pickTritonSeaLevel ( const DtVector &  start,
const DtVector &  end,
DtVector &  result,
DtVector &  normal,
DtVector *  nearPlanePosition = 0 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::doOceanIntersect ( const DtVector &  start,
const DtVector &  end,
DtVector &  oceanIntersectLocation,
DtVector &  oceanIntersectNormal 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectTritonWaves ( const DtVector &  start,
const DtVector &  dir,
DtVector &  result,
DtVector &  normal 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectTritonSeaLevel ( const DtVector &  start,
const DtVector &  dir,
DtVector &  seaPlane,
DtVector &  normal 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectionBelowSeaLevel ( const DtIntersectorResult &  intersection) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::addOceanIntersectIfCloser ( const DtVector &  start,
const DtVector &  end,
bool  intersectionHasResult,
DtOsgIntersectorResult &  intersection 
) const
protectedvirtual
virtual void makVrv::DtTritonIntersector::fillOceanIntersection ( const DtVector &  oceanIntersectLocation,
const DtVector &  oceanIntersectNormal,
DtIntersectorResult &  intersection 
) const
protectedvirtual
virtual bool makVrv::DtTritonIntersector::calcEndpointsFromDirectionAndLength ( double  x,
double  y,
double  z,
double  vx,
double  vy,
double  vz,
double  length,
const DtSceneRootList &  intersectionRoots,
DtVector &  startPoint,
DtVector &  endPoint 
) const
protectedvirtual

Reimplemented from makVrv::DtOsgIntersector.

virtual void makVrv::DtTritonIntersector::transformSeaLevelForTritonManager ( DtVector &  seaLevel) const
protectedvirtual

transform the sea level for input that triton manager expects

virtual void makVrv::DtTritonIntersector::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

Member Data Documentation

const DtDynamicOceanObjectManager& makVrv::DtTritonIntersector::myDynamicOceanObjectManager
protected
DtSignalConnectionManager makVrv::DtTritonIntersector::myConnections
protected
DtCoordinateConverter* makVrv::DtTritonIntersector::myCoordinateConverter = nullptr
protected

local clone of the current system wide coordinate system converter. for thread safety.

DtTritonManager& makVrv::DtTritonIntersector::myTritonManager
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)