VR-Forces 5.0.1 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, int modelSet)
 
virtual ~DtTritonIntersector ()
 
 DtTritonIntersector ()=delete
 
 DtTritonIntersector (const DtTritonIntersector &rhs)=delete
 
DtTritonIntersectoroperator= (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) 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) 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) 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) 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, int modelSet)
 
virtual ~DtOsgIntersector ()
 
 DtOsgIntersector ()=delete
 
 DtOsgIntersector (const DtOsgIntersector &rhs)=delete
 
DtOsgIntersectoroperator= (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
 
- Public Member Functions inherited from makVrv::DtIntersector
 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
 

Protected Member Functions

virtual bool doOceanPick (const DtVector &start, const DtVector &end, DtVector &oceanIntersectLocation, DtVector &oceanIntersectNormal, DtVector *nearPlanePosition=0)
 
virtual bool pickTritonWaves (const DtVector &start, const DtVector &end, DtVector &result, DtVector &normal, DtVector *nearPlanePosition=0)
 
virtual bool pickTritonSeaLevel (const DtVector &start, const DtVector &end, DtVector &result, DtVector &normal, DtVector *nearPlanePosition=0)
 
virtual bool doOceanIntersect (const DtVector &start, const DtVector &end, DtVector &oceanIntersectLocation, DtVector &oceanIntersectNormal)
 
virtual bool intersectTritonWaves (const DtVector &start, const DtVector &dir, DtVector &result, DtVector &normal)
 
virtual bool intersectTritonSeaLevel (const DtVector &start, const DtVector &dir, DtVector &seaPlane, DtVector &normal)
 
virtual bool intersectionBelowSeaLevel (const DtIntersectorResult &intersection)
 
virtual bool addOceanIntersectIfCloser (const DtVector &start, const DtVector &end, bool intersectionHasResult, DtOsgIntersectorResult &intersection)
 
virtual void fillOceanIntersection (const DtVector &oceanIntersectLocation, const DtVector &oceanIntersectNormal, DtIntersectorResult &intersection)
 
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)
 
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)
 

Protected Attributes

const DtDynamicOceanObjectManagermyDynamicOceanObjectManager
 
DtSignalConnectionManager myConnections
 
DtCoordinateConvertermyCoordinateConverter = nullptr
 
DtTritonManagermyTritonManager
 
- Protected Attributes inherited from makVrv::DtIntersector
DtDemyDe
 
DynamicOceanProperties myDynamicOceanProperties
 
CachedPick myLastPick
 
bool myLastPickSucceeded
 
DtIntersectorResult myLastResult
 
double myDefaultMaxClamp
 
const int myModelSet
 

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,
int  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 
)
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 
)
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 
)
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 
)
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 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::pickTritonWaves ( const DtVector start,
const DtVector end,
DtVector result,
DtVector normal,
DtVector nearPlanePosition = 0 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::pickTritonSeaLevel ( const DtVector start,
const DtVector end,
DtVector result,
DtVector normal,
DtVector nearPlanePosition = 0 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::doOceanIntersect ( const DtVector start,
const DtVector end,
DtVector oceanIntersectLocation,
DtVector oceanIntersectNormal 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectTritonWaves ( const DtVector start,
const DtVector dir,
DtVector result,
DtVector normal 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectTritonSeaLevel ( const DtVector start,
const DtVector dir,
DtVector seaPlane,
DtVector normal 
)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::intersectionBelowSeaLevel ( const DtIntersectorResult intersection)
protectedvirtual
virtual bool makVrv::DtTritonIntersector::addOceanIntersectIfCloser ( const DtVector start,
const DtVector end,
bool  intersectionHasResult,
DtOsgIntersectorResult intersection 
)
protectedvirtual
virtual void makVrv::DtTritonIntersector::fillOceanIntersection ( const DtVector oceanIntersectLocation,
const DtVector oceanIntersectNormal,
DtIntersectorResult intersection 
)
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)