VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtObserverAnimator.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 <vrvCore/vrvCore.h>
13 
14 #include <vrvCore/DtUniqueID.h>
16 
17 #include <vrvUtil/DtQuat.h>
19 
21 
22 #include <matrix/vlVector.h>
23 #include <matrix/vlTaitBryan.h>
24 
25 #include <string>
26 
27 namespace makVrv
28 {
29  class DtDe;
30  class DtObserver;
31  class DtEaser;
32  class DtCoordinateSystem;
33 
40  {
41  public:
44  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector geocEndPos,
45  DtTaitBryan geocEndOri, double endZoom, float smoothTime = 3.0f);
46 
49  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector cigEndPos,
50  DtQuat cigEndOri, double endZoom, float smoothTime = 3.0f);
51 
54  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector relativeEndPos,
55  DtQuat relativeEndOri, double endZoom, DtUniqueID attachedTo,
56  DtUniqueID secondaryAttachedTo,
57  DtObserverObject::AttachType attachedType, float smoothTime = 3.0f);
58 
61  makArchives::DtObserverStateRecord& rec, float smoothTime = 3.0f);
62 
64  virtual ~DtObserverAnimator();
65 
68  virtual void tick();
69 
72  virtual bool isDone() const;
73 
75  virtual DtObserver* observer() const;
76 
77  protected:
80  struct EntityInfo
81  {
82  bool isValid;
85  DtTaitBryan geoOri;
87  DtTaitBryan cigOri;
88  };
89 
92  virtual EntityInfo entityInfo(makVrv::DtDe& de,
93  const std::string& displayName);
94  virtual EntityInfo entityInfo(makVrv::DtDe& de, DtUniqueID elementId);
95 
99  virtual void updateTargets();
100 
101  // onInit is not virtual, because it is called by the constructor
102  void onInit();
103 
106  virtual void updateObserver();
107 
110  virtual DtVector calcTargetPosition();
111 
114  virtual DtQuat calcTargetOrientation();
115 
118  virtual void calculateUpVector();
119 
126  virtual void interpolatePosition(double t);
127 
137  virtual void interpolateOrientation(double t);
138 
144  virtual void interpolateZoom(double t);
145 
148  virtual void finish();
149 
151  virtual void slot_coordinateSystemChanged();
152 
153  //helper functions to assist with the animation
156  virtual double altitude(const DtVector& geoPos);
158  virtual DtVector surfaceAt(const DtVector& geoPos);
160  virtual DtVector clampAltitude(const DtVector& geoPos);
163  virtual DtVector bounce(double dt, DtVector start, DtVector end);
167  virtual double altitudeContrib();
171  virtual double phase1Contrib(double t);
175  virtual double phase3Contrib(double t);
178  virtual double calculatePercentage(double s, double e, double t);
181  virtual double calculateEasedPercent(double t);
182 
184  void initCoordinateSystem();
185 
186  protected:
187 
189 
193 
194  bool myIsDone;
195 
201 
202  //these are all geocentric locations
208 
210 
211  //these are IG orientations
216 
217  //for trying to find a target location when the attachment point is on
218  //a moving target
221 
222  //Animator needs to know if it is a 2D mode so it can use view resolution instead of zoom
224 
225  double myStartZoom;
227  double myEndZoom;
228 
229  double myStartTime;
231  double myEndTime;
232 
235 
238 
240 
243  DtCoordinateSystem* myCoordinateSystem = nullptr;
244  };
245 } //makVrv::
DtEaser * myEaser
Definition: DtObserverAnimator.h:188
double myStartTime
Definition: DtObserverAnimator.h:229
DtVector myPreviousPosition
Definition: DtObserverAnimator.h:204
bool myIsAttached
Definition: DtObserverAnimator.h:197
DtQuat myTargetOrientation
Definition: DtObserverAnimator.h:220
DtQuat myCurrentOrientation
Definition: DtObserverAnimator.h:213
bool myShouldUseVelocity
Definition: DtObserverAnimator.h:236
double myEndTime
Definition: DtObserverAnimator.h:231
bool myShouldFaceEarth
Definition: DtObserverAnimator.h:237
float mySmoothTime
Definition: DtObserverAnimator.h:192
DtVector geoPos
Definition: DtObserverAnimator.h:84
double myCurrentZoom
Definition: DtObserverAnimator.h:226
makVrv::DtDe & myDe
Definition: DtObserverAnimator.h:190
A DtObserverSettingsRecord contains the state of an observer.
Definition: DtObserverStateRecord.h:20
DtSignalConnectionManager myConnections
Definition: DtObserverAnimator.h:239
DtVector myLocationTrackAttachment
Definition: DtObserverAnimator.h:200
DtQuat myOffsetOrientation
Definition: DtObserverAnimator.h:215
DtTaitBryan cigOri
Definition: DtObserverAnimator.h:87
DtUniqueID myAttachedTo
Definition: DtObserverAnimator.h:198
DtVector myEndPosition
Definition: DtObserverAnimator.h:206
double myStartZoom
Definition: DtObserverAnimator.h:225
DtVector cigPos
Definition: DtObserverAnimator.h:86
DtVector myStartPosition
Definition: DtObserverAnimator.h:203
double myEndZoom
Definition: DtObserverAnimator.h:227
DtVector myTargetPosition
Definition: DtObserverAnimator.h:219
A facade for a DtObserverObject.
Definition: DtObserver.h:37
DtTaitBryan geoOri
Definition: DtObserverAnimator.h:85
Contains makVrv::DtObserverObject class.
DtQuat myEndOrienation
Definition: DtObserverAnimator.h:214
Data structure used to store information about an entity that the observer is moving towards and will...
Definition: DtObserverAnimator.h:80
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
double myCurrentTime
Definition: DtObserverAnimator.h:230
The easer class DtEaser return values along a bezier curve between input point 1 and point 2...
Definition: DtEaser.h:17
DtVector myOffsetPosition
Definition: DtObserverAnimator.h:207
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
DtQuat myStartOrientation
Definition: DtObserverAnimator.h:212
Contains makVrv::DtQuat class.
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
bool myIsDone
Definition: DtObserverAnimator.h:194
Contains makArchives::DtObserverStateRecord class.
Encapsulates the process of animating an observer to a given location. The animator will smoothly mov...
Definition: DtObserverAnimator.h:39
Base class to provide boost signal/slot management.
bool isValid
Definition: DtObserverAnimator.h:82
DtUniqueID mySecondaryAttachedTo
Definition: DtObserverAnimator.h:199
DtObserverObject::AttachType myAttachType
Definition: DtObserverAnimator.h:196
Contains makVrv::DtUniqueID type.
bool myIs2DObsMode
Definition: DtObserverAnimator.h:223
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
makVrv::DtObserver & myObserver
Definition: DtObserverAnimator.h:191
A utility Quaternion class.
Definition: DtQuat.h:19
DtVector myCurrentPosition
Definition: DtObserverAnimator.h:205
DtVector myUpVector
Definition: DtObserverAnimator.h:209
double myTravelDistance
Definition: DtObserverAnimator.h:233
DtUniqueID elementId
Definition: DtObserverAnimator.h:83
double myCurrentAltitude
Definition: DtObserverAnimator.h:234
AttachType
Definition: DtObserverObject.h:39
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)