VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
attachedTerrain.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 
18 #include <readerWriter/rwInt.h>
19 #include <readerWriter/rwString.h>
20 #include <readerWriter/rwBoolean.h>
22 #include <matrix/vlDcm.h>
24 #include <geometry/point.h>
25 #include <geometry/chord.h>
26 #include <matrix/topoCoord.h>
27 #include <matrix/geodeticCoord.h>
28 #include <matrix/coordTransform.h>
29 #include <matrix/3dBoundingVolume.h>
30 
31 #include <boost/shared_ptr.hpp>
32 #include <boost/optional.hpp>
33 
34 class DtTerrainInterface;
35 class DtPhysicalWorld;
36 class DtVrfObject;
39 class DtSurface;
40 class Coordinate_System;
41 
43 {
44 public:
45 
48 
50  DtAttachedTerrain(const DtString& name,
51  DtReaderWriterRegistry* const parentRegistry = 0, DtVrfObject* owner = 0);
52 
53  DtAttachedTerrain(const DtSymbolString& name,
54  DtReaderWriterRegistry* const parentRegistry = 0, DtVrfObject* owner = 0);
55 
57  DtAttachedTerrain(const DtString& name, const DtAttachedTerrain& orig,
58  DtReaderWriterRegistry* const parentRegistry = 0);
59 
61  from, DtReaderWriterRegistry* const parentRegistry = 0);
62 
64  virtual ~DtAttachedTerrain();
65 
67  virtual DtVrfObject* vrfObject() const;
68 
71 
75  virtual const char* readerWriterType() const;
76 
77  static void objectAboutToBeRemovedCallback(const DtVrfObject * vrfObject, void * usr);
78  virtual void processObjectAboutToBeRemovedCallback(const DtVrfObject * vrfObject);
79 
80 public:
81  virtual const Coordinate_System* coordinateSystem() const;
82  virtual Coordinate_System* coordinateSystem();
83 
86  virtual void tick();
87 
89  virtual bool isHighFidelityTerrain() const;
90 
91  virtual bool skipThisObject() const;
92 
94  virtual void setStayAttachedEvenIfOff(bool);
95  virtual bool stayAttachedEvenIfOff() const;
96 
97  void setFallThroughToPhysicalWorld(bool val);
98  bool fallThroughToPhysicalWorld() const;
99 
100  virtual double terrainHeight(const DtVector& localLocation,
101  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
102  virtual bool terrainHeight(const DtVector& localLocation,
103  double& terrainHeight, bool* dataAvailable = 0,
104  bool overrideBlockingAssert = false) const;
105 
106  virtual bool terrainHeightAndSurface(double lat, double lon,
107  double& terrainHeight, DtSurface& surface, bool* dataAvailable = 0,
108  bool overrideBlockingAssert = false) const;
109 
110  virtual bool terrainHeightAndSurface(const DtVector& localLocation,
111  double& terrainHeight, DtSurface& surface, bool* dataAvailable = 0,
112  bool overrideBlockingAssert = false) const;
113 
114 
115  virtual bool closestIntersection(const DtVector& localLocation,
116  DtPoint& intersectionPoint,
117  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
118 
119  virtual bool closestIntersection(const DtVector& localLocation,
120  DtVector& intersectionPoint,
121  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
122 
123  virtual bool closestIntersection(const DtVector& localLocation,
127  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
128 
129  virtual bool intersect(const DtChord& chord, DtPoint& intersectionPoint,
130  double& intersectionTime,
131  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
132 
133  virtual bool intersect(const DtChord& chord,
137  bool* dataAvailable = 0, bool overrideBlockingAssert = false) const;
138 
145  virtual bool closestIntersection(const DtVector& curPosition,
146  DtVector& intersection, bool ignoreWater, bool* dataAvailable = 0,
147  bool overrideBlockingAssert = false) const;
148 
174  virtual bool allIntersectsAlongChord(const DtChord& chord,
177  DtIntersectionRecord::INT_ALL_DATA, bool* dataAvailable = 0,
178  bool overrideBlockingAssert = false) const;
179 
180 protected:
181  bool testInvariant() const;
182 
184  virtual void updateCoordTransforms();
185 
187  virtual void updateBoundingVolume();
188 
190  virtual DtVector convertLocalPointToModelPoint(const DtVector& source) const;
191 
194  virtual DtChord convertLocalChordToModelChord(const DtChord& source) const;
195 
197  virtual DtVector convertModelPointToDatabasePoint(const DtPoint&) const;
198 
201  virtual void convertModelPointToDatabasePoint(DtVrfChordIntersectionRecord&) const;
202 
203  virtual unsigned intersectChordWithBoundingVolume(const DtChord& chord,
204  DtVrfChordIntersectionRecord* isect1 = 0,
205  DtVrfChordIntersectionRecord* isect2 = 0) const;
206 
207  virtual unsigned intersectChordWithBoundingVolume(const DtChord& chord, bool calculateNormal,
208  DtVrfChordIntersectionRecord* isect1 = 0,
209  DtVrfChordIntersectionRecord* isect2 = 0) const;
210 
211  virtual bool boundingVolumeAltitude(const DtVector& p, double& alt) const;
212 
213  virtual void closestPointToBoundingVolume(const DtPoint& p, DtVrfChordIntersectionRecord& out) const;
214 
215 public:
216  virtual bool entityIsValidAndAttached() const;
217 
218  virtual int appearanceFlags() const;
219 
220  void setObjectGeometricModel(boost::shared_ptr<DtTerrainInterface> newObjGeomModel);
221  boost::shared_ptr<DtTerrainInterface> objectGeometricModel() const;
222 
223  void setEntity(const DtSharedVrfObjectReference);
225 
226  void setPhysicalWorld(DtPhysicalWorld* newPhysicalWorld);
227  DtPhysicalWorld* physicalWorld();
228  const DtPhysicalWorld* physicalWorld() const;
229 
230  void clear();
231 
232  virtual DtAttachedTerrain* clone(const DtString& name, DtReaderWriterRegistry* const parentRegistry = 0) const;
233 
234 protected:
236 
238  boost::shared_ptr<DtTerrainInterface> myObjectGeometricModel;
239 
243 
246  DtCoordTransform myGeocentricToTopographic;
247  DtCoordTransform myTopographicToGeocentric;
248  DtCoordTransform myModelNormalToLocalNormal;
253  boost::optional<Dt3dBoundingVolume> myLastLocalBoundingVolume;
254 
257 
266 };
267 
DtVector myLastWorldPosition
Definition: attachedTerrain.h:251
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
boost::shared_ptr< DtTerrainInterface > myObjectGeometricModel
For now, this is the model that we get.
Definition: attachedTerrain.h:238
DtVrfObject * myVrfObject
Definition: attachedTerrain.h:255
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is.
Definition: attachedTerrain.h:42
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords.
Definition: vrfChordIntersectRecordList.h:31
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtDcm myLastWorldOrientationMatrix
Definition: attachedTerrain.h:249
Definition: symbolString.h:20
DtCoordTransform myModelNormalToLocalNormal
Definition: attachedTerrain.h:248
DtRwVrfObjectReference myEntity
Definition: attachedTerrain.h:235
int myAttachedEntityAppearance
Definition: attachedTerrain.h:259
Definition: readerWriter.h:85
*bool testInvariant() const
**virtual void setObjectGeometricModel(const DtObjectGeometricModel *)
boost::optional< Dt3dBoundingVolume > myLastLocalBoundingVolume
Definition: attachedTerrain.h:253
Definition: readerWriterRegistry.h:39
Definition: surface.h:179
DtPhysicalWorld * myPhysicalWorld
For now,just use the global terrain database to return the coordinate system and perform the intersec...
Definition: attachedTerrain.h:242
DtVector myLastLocalPosition
Definition: attachedTerrain.h:252
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
bool myAttachedEntityIsMobile
Definition: attachedTerrain.h:260
The DtPhysicalWorld is the primary interface to and manager of all of the &quot;physical&quot; aspects of the s...
Definition: physicalWorld.h:88
Definition: coordSystem.h:54
DtDcm myLastLocalOrientationMatrix
Definition: attachedTerrain.h:250
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
bool myInitialPlacement
Definition: attachedTerrain.h:264
DtRwBoolean myStayAttachedEvenIfOff
Definition: attachedTerrain.h:256
DtTerrainInterface allows access to common terrain calls without having to know the terrain implement...
Definition: terrainInterface.h:88
const char * source
Definition: lz4.h:442
bool myFallThroughToPhysicalWorld
Definition: attachedTerrain.h:258
bool myCheckMovingToNonMoving
Definition: attachedTerrain.h:262
Class used as the reader/writer implementation of the DtVrfObjectReference.
Definition: vrfObjectReference.h:204
*virtual const DtObjectGeometricModel * objectGeometricModel() const
Definition: vrfChordIntersectionRecord.h:19
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...
bool myScenarioIsRunning
Definition: attachedTerrain.h:261
Definition: intersectionRecord.h:60
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
A DtChord is a finite line segment in 3-space, represented by two points.
DtCoordTransform myGeocentricToTopographic
Last local orientation of the referenced entity.
Definition: attachedTerrain.h:246
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
bool myBVChanged
Definition: attachedTerrain.h:263
DtCoordTransform myTopographicToGeocentric
Definition: attachedTerrain.h:247
Definition: point.h:34
bool myMadeInitialPlacement
Definition: attachedTerrain.h:265
DtIntersectionType
Definition: intersectionRecord.h:41

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)