VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIntersector.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 #include <vrvCore/vrvCore.h>
14 
15 #include <vector>
16 
17 namespace makVrv
18 {
19  class DtDe;
20  class DtChannel;
21 
26  {
27  public:
28 
32  {
33  AllNodes = 0,
34  PickableNodes = 1,
35  SupportNodes = 2,
36  NodesThatReceivesShadows = 4,
37  NodesThatCastsShadows = 8,
38  OsgEarthTerrainSkin = 16,
39  TerrainPatchInsetNotOsgEarth = 32
40  };
41 
43  {
44  DynamicOceanPropertyMsl = 0,
45  DynamicOceanPropertyWaves = 1,
46  DynamicOceanPropertyIgnore = 2
47  };
48 
50  typedef std::vector<DtIntersectorResult> DtIntersections;
51 
53  DtIntersector( DtDe& de, DtModelSetId modelSet );
54 
56  virtual ~DtIntersector();
57 
60  virtual void setDynamicOceanProperties( DynamicOceanProperties properties );
61 
63  virtual DynamicOceanProperties dynamicOceanProperties() const;
64 
79  virtual bool findNearestIntersectionToPoint(double x, double y, double z,
80  double vx, double vy, double vz, DtIntersectorResult& intersection,
81  IntersectProperties properties = AllNodes,
82  std::vector<DtElementID>* ignoreList = 0, bool returnTriangle = false,
83  double maxIsectorLength = -1., bool useHighLod = false ) const = 0;
84 
92  virtual bool findAllIntersectionsThroughPoint( double x, double y, double z,
93  double vx, double vy, double vz, DtIntersections& intersections,
94  IntersectProperties properties = AllNodes,
95  std::vector<DtElementID>* ignoreList = 0, bool sort = true,
96  bool useHighLod = false ) const = 0;
97 
104  virtual bool findFirstIntersectWithLineSegment(
105  double x, double y, double z, double end_x, double end_y, double end_z,
107  IntersectProperties properties=AllNodes,
108  std::vector<DtElementID>* ignoreList=0,
109  bool useHighLod = false) const = 0;
110 
117  virtual bool findAllIntersectWithLineSegment(
118  double x, double y, double z, double end_x, double end_y, double end_z,
119  DtIntersections& intersections,
120  IntersectProperties properties=AllNodes,
121  std::vector<DtElementID>* ignoreList=0, bool sort=true,
122  bool useHighLod = false ) const = 0;
123 
129  virtual bool pick( DtChannel& channel, double mx, double my,
131  IntersectProperties properties=AllNodes,
132  std::vector<DtElementID>* ignoreList=0) = 0;
133 
138  virtual bool pickAll( DtChannel* channel, double mx, double my,
139  DtIntersections& intersections,
140  IntersectProperties properties=AllNodes,
141  std::vector<DtElementID>* ignoreList=0) = 0;
142 
144  virtual void setDefaultMaxClamp(double maximumIsectorLength);
152  virtual double defaultMaxClamp() const;
154 
155  virtual DtModelSetId modelSet(void) const;
156 
157  protected:
160 
163  struct CachedPick
164  {
166  : simTime(0.0)
167  , channel(0)
168  , mx(0)
169  , my(0)
170  , properties(DtIntersector::AllNodes)
171  , ignoreList(0)
172  {
173  }
174 
175  bool operator==(const CachedPick& b)
176  {
177  return simTime == b.simTime &&
178  channel == b.channel &&
179  mx == b.mx &&
180  my == b.my &&
181  properties == b.properties &&
182  ignoreList == b.ignoreList;
183  }
184 
185  double simTime;
187  double mx;
188  double my;
190  std::vector<DtElementID>* ignoreList;
191  };
192 
197 
199 
200  };
201 }
IntersectProperties
The IntersectProperties enum is a flag set that indicates the types of nodes to be considered for int...
Definition: DtIntersector.h:31
IntersectProperties properties
Definition: DtIntersector.h:189
DtIntersectorResult myLastResult
Definition: DtIntersector.h:195
CachedPick()
Definition: DtIntersector.h:165
DtIntersector is an abstract class that provides the interface for requesting intersections with the ...
Definition: DtIntersector.h:25
CachedPick myLastPick
Definition: DtIntersector.h:193
Descriptor for a single intersection result.
Definition: DtIntersectorResult.h:21
std::vector< DtIntersectorResult > DtIntersections
A vector of DtIntersectionRecords.
Definition: DtIntersector.h:50
Contains makVrv::DtIntersectorCreator class.
DtDe & myDe
Definition: DtIntersector.h:158
const DtModelSetId myModelSet
Definition: DtIntersector.h:198
DynamicOceanProperties
Definition: DtIntersector.h:42
bool myLastPickSucceeded
Definition: DtIntersector.h:194
The abstract Channel Class.
Definition: DtChannel.h:35
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
bool operator==(const CachedPick &b)
Definition: DtIntersector.h:175
double simTime
Definition: DtIntersector.h:185
double mx
Definition: DtIntersector.h:187
DynamicOceanProperties myDynamicOceanProperties
Definition: DtIntersector.h:159
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...
CachedPick is a container class for the information to cache a pick request.
Definition: DtIntersector.h:163
double myDefaultMaxClamp
Definition: DtIntersector.h:196
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:72
double my
Definition: DtIntersector.h:188
DtModelSetId
Definition: DtModelSetEnums.h:19
std::vector< DtElementID > * ignoreList
Definition: DtIntersector.h:190
DtChannel * channel
Definition: DtIntersector.h:186
Contains DLL export macros.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)