VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtObserverAnimator.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 <vrvCore/vrvCore.h>
13 
14 #include <vrvCore/DtUniqueID.h>
16 
17 
19 
20 #include <matrix/vlVector.h>
21 #include <matrix/vlTaitBryan.h>
22 #include <vrvUtil/DtQuat.h>
23 
24 #include <string>
25 
26 namespace makVrv
27 {
28  class DtDe;
29  class DtObserver;
30  class DtEaser;
31 
38  {
39  public:
42  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector geocEndPos,
43  DtTaitBryan geocEndOri, double endZoom, float smoothTime = 3.0f);
44 
47  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector cigEndPos,
48  DtQuat cigEndOri, double endZoom, float smoothTime = 3.0f);
49 
52  DtObserverAnimator(DtDe& de, DtObserver& obs, DtVector relativeEndPos,
53  DtQuat relativeEndOri, double endZoom, DtUniqueID attachedTo,
54  DtUniqueID secondaryAttachedTo,
55  DtObserverObject::AttachType attachedType, float smoothTime = 3.0f);
56 
59  makArchives::DtObserverStateRecord& rec, float smoothTime = 3.0f);
60 
62  virtual ~DtObserverAnimator();
63 
66  virtual void tick();
67 
70  virtual bool isDone() const;
71 
73  virtual DtObserver* observer() const;
74 
75  protected:
78  struct EntityInfo
79  {
80  bool isValid;
83  DtTaitBryan geoOri;
85  DtTaitBryan cigOri;
86  };
87 
90  virtual EntityInfo entityInfo(makVrv::DtDe& de,
91  std::string displayName);
92  virtual EntityInfo entityInfo(makVrv::DtDe& de, DtUniqueID elementId);
93 
97  virtual void updateTargets();
98 
99  // onInit is not virtual, because it is called by the constructor
100  void onInit();
101 
104  virtual void updateObserver();
105 
108  virtual DtVector calcTargetPosition();
109 
112  virtual DtQuat calcTargetOrientation();
113 
116  virtual void calculateUpVector();
117 
124  virtual void interpolatePosition(double t);
125 
135  virtual void interpolateOrientation(double t);
136 
142  virtual void interpolateZoom(double t);
143 
146  virtual void finish();
147 
149 
153 
154  bool myIsDone;
155 
160 
161  //these are all geocentric locations
167 
169 
170  //these are IG orientations
175 
176  //for trying to find a target location when the attachment point is on
177  //a moving target
180 
181  //Animator needs to know if it is a 2D mode so it can use view resolution instead of zoom
183 
184  double myStartZoom;
186  double myEndZoom;
187 
188  double myStartTime;
190  double myEndTime;
191 
194 
197 
198  //helper functions to assist with the animation
201  virtual double altitude(DtVector geoPos);
203  virtual DtVector surfaceAt(DtVector geoPos);
205  virtual DtVector clampAltitude(DtVector geoPos);
208  virtual DtVector bounce(double dt, DtVector start, DtVector end);
212  virtual double altitudeContrib();
216  virtual double phase1Contrib(double t);
220  virtual double phase3Contrib(double t);
223  virtual double calculatePercentage(double s, double e, double t);
226  virtual double calculateEasedPercent(double t);
227  };
228 } //makVrv::

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)