VR-Forces 4.8 Class Documentation
 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) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvTriton/vrvTriton.h>
13 
15 
16 #include <matrix/vlVector.h>
17 
18 namespace makVrv
19 {
20  class DtCameraNode;
21  class DtDynamicOceanObjectManager;
22 
29  {
30  public:
32  DtTritonIntersector( DtDe& de, int modelSet );
33 
35  virtual ~DtTritonIntersector();
36 
56  virtual bool findNearestIntersection(double x, double y, double z,
57  double vx, double vy, double vz, DtOsgIntersectorResult& intersection,
58  const DtSceneRootList& intersectionRoots, osg::Node::NodeMask mask,
59  DtOsgItersectorExclusions* exclusions, bool returnHitTriangle,
60  double maxIsectorLength, bool useHighLod );
61 
75  virtual bool findIntersectionsThroughPoint(double x, double y, double z,
76  double vx, double vy, double vz,
78  const DtSceneRootList& intersectionRoots, osg::Node::NodeMask mask,
79  DtOsgItersectorExclusions* exclusions, bool returnHitTriangle,
80  double maxIsectorLength, bool sort, bool useHighLod );
81 
87  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
88  double end_x, double end_y, double end_z,
89  DtOsgIntersectorResult& intersection,
90  const DtSceneRootList& intersectionRoots,
91  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
92  DtOsgItersectorExclusions* exclusions=0,
93  bool returnHitTriangle=false, bool useHighLod=false );
94 
100  virtual bool intersectLineSegmentWithScene( double x, double y, double z,
101  double end_x, double end_y, double end_z,
102  DtOsgIntersector::DtOsgIntersections& intersections,
103  const DtSceneRootList& intersectionRoots,
104  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
105  DtOsgItersectorExclusions* exclusions=0,
106  bool returnHitTriangle=false, bool sort=true, bool useHighLod=false );
107 
110  virtual bool pick( osgViewer::View& view, double mx, double my,
111  DtOsgIntersectorResult& intersection,
112  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
113  DtOsgItersectorExclusions* exclusions=0,
114  bool returnHitTriangle=false );
115 
118  virtual bool pick( osgViewer::View& view, double mx, double my,
120  osg::Node::NodeMask mask=DtOsgNodeFlags::FlagAllOn,
121  DtOsgItersectorExclusions* exclusions=0,
122  bool returnHitTriangle=false );
123 
124  protected:
125  virtual bool doOceanPick( const DtCameraNode& sceneCamera, double mx,
126  double my, DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal,
127  DtVector* nearPlanePosition=0 );
128 
129  virtual bool pickTritonWaves( const DtCameraNode& sceneCamera, double mx,
130  double my, DtVector& result, DtVector& normal,
131  DtVector* nearPlanePosition=0 );
132 
133  virtual bool pickTritonSeaLevel( const DtCameraNode& sceneCamera,
134  double mx, double my, DtVector& result, DtVector& normal,
135  DtVector* nearPlanePosition=0 );
136 
137  virtual bool doOceanIntersect( const DtVector& start, const DtVector& end,
138  DtVector& oceanIntersectLocation, DtVector& oceanIntersectNormal );
139 
140  virtual bool intersectTritonWaves( const DtVector& start, const DtVector& dir,
141  DtVector& result, DtVector& normal );
142 
143  virtual bool intersectTritonSeaLevel( const DtVector& start, const DtVector& dir,
144  DtVector& seaPlane, DtVector& normal );
145 
146  virtual bool intersectionBelowSeaLevel(const DtIntersectorResult& intersection );
147 
148  // Returns true if there is a valid intersection in 'intersection'
149  virtual bool addOceanIntersectIfCloser( const DtVector& start, const DtVector& end,
150  bool intersectionHasResult, DtOsgIntersectorResult& intersection );
151 
152  virtual void fillOceanIntersection( const DtVector& oceanIntersectLocation,
153  const DtVector& oceanIntersectNormal, DtIntersectorResult& intersection );
154 
155  virtual bool calcEndpointsFromDirectionAndLength( double x, double y,
156  double z, double vx, double vy, double vz, double length,
157  const DtSceneRootList& intersectionRoots, DtVector& startPoint,
158  DtVector& endPoint ) const;
159 
160  protected:
162 
163  };
164 
168  {
169  public:
171  virtual DtIntersector* create(DtDe& de, int modelSet );
172  };
173 }
std::vector< DtSceneRoot > DtSceneRootList
A list of DtOsgRenderer::SceneRoots.
Definition: DtSceneRoot.h:117
Contains makVrv:DtOsgIntersector class.
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:129
DtOsgIntersector is the OSG-specific implementation of the DtIntersector class.
Definition: DtOsgIntersector.h:82
DtOsgIntersectorResult is the OSG-specific implementation of DtIntersectorResult; it is a container c...
Definition: DtOsgIntersector.h:62
Descriptor for a single intersection result.
Definition: DtIntersector.h:33
std::vector< DtOsgIntersectorResult > DtOsgIntersections
Note that even with intersection debug drawing enabled, these OSG-specific functions do not result in...
Definition: DtOsgIntersector.h:189
Abstract creator base class.
Definition: DtTritonIntersector.h:167
static const unsigned int FlagAllOn
Nodemask bitflag definitions.
Definition: DtOsgNodeTraversalFlags.h:19
DtDynamicOceanObjectManager & myDynamicOceanObjectManager
Definition: DtTritonIntersector.h:161
Manager that provides direct access to the dynamic ocean objects in use within a display engine...
Definition: DtDynamicOceanObjectManager.h:27
Contains DLL export macros.
DtTritonIntersector works with the methods in the DtOsgIntersector class to provide a Triton-aware im...
Definition: DtTritonIntersector.h:28
DtOsgItersectorExclusions is a list of osg nodes from the scene graph and a list of element IDs to ex...
Definition: DtOsgIntersector.h:50
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
VR-Vantage specific subclass of OSG camera.
Definition: DtCameraNode.h:30
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...
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Abstract creator base class.
Definition: DtIntersector.h:387

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)