VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTritonIntersector.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvTriton/vrvTriton.h>
13 
15 
17 
18 #include <matrix/vlVector.h>
19 
20 namespace makVrv
21 {
22  class DtCameraNode;
23  class DtDynamicOceanObjectManager;
24  class DtCoordinateConverter;
25  class DtTritonManager;
26 
33  {
34  public:
36  DtTritonIntersector( DtDe& de, DtModelSetId modelSet );
37 
39  virtual ~DtTritonIntersector();
40 
42  DtTritonIntersector() = delete;
44  DtTritonIntersector( const DtTritonIntersector& rhs ) = delete;
46  DtTritonIntersector& operator=( const DtTritonIntersector& rhs ) = delete;
47 
67  virtual bool findNearestIntersection(double x, double y, double z,
68  double vx, double vy, double vz, DtOsgIntersectorResult& intersection,
69  const DtSceneRootList& intersectionRoots, osg::Node::NodeMask mask,
70  DtOsgItersectorExclusions* exclusions, bool returnHitTriangle,
71  double maxIsectorLength, bool useHighLod ) const override;
72 
86  virtual bool findIntersectionsThroughPoint(double x, double y, double z,
87  double vx, double vy, double vz,
89  const DtSceneRootList& intersectionRoots, osg::Node::NodeMask mask,
90  DtOsgItersectorExclusions* exclusions, bool returnHitTriangle,
91  double maxIsectorLength, bool sort, bool useHighLod ) const override;
92 
98  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
99  double end_x, double end_y, double end_z,
100  DtOsgIntersectorResult& intersection,
101  const DtSceneRootList& intersectionRoots,
102  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
103  DtOsgItersectorExclusions* exclusions=0,
104  bool returnHitTriangle=false, bool useHighLod=false ) const override;
105 
111  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
112  double end_x, double end_y, double end_z,
113  DtOsgIntersector::DtOsgIntersections& intersections,
114  const DtSceneRootList& intersectionRoots,
115  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
116  DtOsgItersectorExclusions* exclusions=0,
117  bool returnHitTriangle=false, bool sort=true, bool useHighLod=false ) const override;
118 
121  virtual bool pick( const osgViewer::View& view, double mx, double my,
122  DtOsgIntersectorResult& intersection,
123  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
124  DtOsgItersectorExclusions* exclusions=0,
125  bool returnHitTriangle=false ) override;
126 
129  virtual bool pick(const osgViewer::View& view, double mx, double my,
131  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
132  DtOsgItersectorExclusions* exclusions=0,
133  bool returnHitTriangle=false ) override;
134 
135  protected:
136  virtual bool doOceanPick( const DtVector& start, const DtVector& end
137  , DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal,
138  DtVector* nearPlanePosition=0 ) const;
139 
140  virtual bool pickTritonWaves(const DtVector& start, const DtVector& end
141  , DtVector& result, DtVector& normal,
142  DtVector* nearPlanePosition=0 ) const;
143 
144  virtual bool pickTritonSeaLevel(const DtVector& start, const DtVector& end
145  , DtVector& result, DtVector& normal,
146  DtVector* nearPlanePosition=0 ) const;
147 
148  virtual bool doOceanIntersect( const DtVector& start, const DtVector& end,
149  DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal ) const;
150 
151  virtual bool intersectTritonWaves( const DtVector& start, const DtVector& dir,
152  DtVector& result, DtVector& normal ) const;
153 
154  virtual bool intersectTritonSeaLevel( const DtVector& start, const DtVector& dir,
155  DtVector& seaPlane, DtVector& normal ) const;
156 
157  virtual bool intersectionBelowSeaLevel(const DtIntersectorResult& intersection ) const;
158 
159  // Returns true if there is a valid intersection in 'intersection'
160  virtual bool addOceanIntersectIfCloser( const DtVector& start, const DtVector& end,
161  bool intersectionHasResult, DtOsgIntersectorResult& intersection ) const;
162 
163  virtual void fillOceanIntersection( const DtVector& oceanIntersectLocation,
164  const DtVector& oceanIntersectNormal, DtIntersectorResult& intersection ) const;
165 
166  virtual bool calcEndpointsFromDirectionAndLength( double x, double y,
167  double z, double vx, double vy, double vz, double length,
168  const DtSceneRootList& intersectionRoots, DtVector& startPoint,
169  DtVector& endPoint ) const;
170 
172  virtual void transformSeaLevelForTritonManager(DtVector& seaLevel) const;
173 
175  virtual void slot_coordinateSystemChanged();
176 
177  protected:
179 
181 
184  DtCoordinateConverter* myCoordinateConverter = nullptr;
185 
187  };
188 
192  {
193  public:
195  virtual DtIntersector* create(DtDe& de, DtModelSetId modelSet );
196  };
197 }
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:135
const DtDynamicOceanObjectManager & myDynamicOceanObjectManager
Definition: DtTritonIntersector.h:178
DtCoordinateConverter is the base class for &#39;local (cig) to geocentric&#39; converters.
Definition: DtCoordinateConverter.h:25
Contains makVrv:DtOsgIntersector class.
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:25
DtOsgIntersector is the OSG-specific implementation of the DtIntersector class. It provides a variety...
Definition: DtOsgIntersector.h:66
DtOsgIntersectorResult is the OSG-specific implementation of DtIntersectorResult; it is a container c...
Definition: DtOsgIntersectorResult.h:25
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
std::vector< DtOsgIntersectorResult > DtOsgIntersections
Note that even with intersection debug drawing enabled, these OSG-specific functions do not result in...
Definition: DtOsgIntersector.h:181
Abstract creator base class.
Definition: DtTritonIntersector.h:191
static const unsigned int FlagAllOn
Nodemask bitflag definitions.
Definition: DtOsgNodeTraversalFlags.h:19
Manager that provides direct access to the dynamic ocean objects in use within a display engine...
Definition: DtDynamicOceanObjectManager.h:27
Contains DLL export macros.
DtTritonManager & myTritonManager
Definition: DtTritonIntersector.h:186
DtTritonIntersector works with the methods in the DtOsgIntersector class to provide a Triton-aware im...
Definition: DtTritonIntersector.h:32
DtOsgItersectorExclusions is a list of osg nodes from the scene graph and a list of element IDs to ex...
Definition: DtOsgIntersector.h:53
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtSignalConnectionManager myConnections
Definition: DtTritonIntersector.h:180
DT_DLL_vrfutil bool intersection(const DtRailSegment *currentSegment, const DtRailSegment *nextSegment)
Given two segments, determine if where they meet is an intersection or just a bend in the road...
Base class to provide boost signal/slot management.
Definition: DtTritonManager.h:49
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Abstract creator base class.
Definition: DtIntersectorCreator.h:24
DtModelSetId
Definition: DtModelSetEnums.h:19

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)