VR-Forces 5.0.1 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) 2022 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, int 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 ) 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 ) 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 ) 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 ) 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 );
139 
140  virtual bool pickTritonWaves(const DtVector& start, const DtVector& end
141  , DtVector& result, DtVector& normal,
142  DtVector* nearPlanePosition=0 );
143 
144  virtual bool pickTritonSeaLevel(const DtVector& start, const DtVector& end
145  , DtVector& result, DtVector& normal,
146  DtVector* nearPlanePosition=0 );
147 
148  virtual bool doOceanIntersect( const DtVector& start, const DtVector& end,
149  DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal );
150 
151  virtual bool intersectTritonWaves( const DtVector& start, const DtVector& dir,
152  DtVector& result, DtVector& normal );
153 
154  virtual bool intersectTritonSeaLevel( const DtVector& start, const DtVector& dir,
155  DtVector& seaPlane, DtVector& normal );
156 
157  virtual bool intersectionBelowSeaLevel(const DtIntersectorResult& intersection );
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 );
162 
163  virtual void fillOceanIntersection( const DtVector& oceanIntersectLocation,
164  const DtVector& oceanIntersectNormal, DtIntersectorResult& intersection );
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, int modelSet );
196  };
197 }
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:133
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:67
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:54
#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:48
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:70
Abstract creator base class.
Definition: DtIntersectorCreator.h:23

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)