VR-Forces 4.6.1 Class Documentation
 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) 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  const 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 
161 
162  //these are all geocentric locations
168 
170 
171  //these are IG orientations
176 
177  //for trying to find a target location when the attachment point is on
178  //a moving target
181 
182  //Animator needs to know if it is a 2D mode so it can use view resolution instead of zoom
184 
185  double myStartZoom;
187  double myEndZoom;
188 
189  double myStartTime;
191  double myEndTime;
192 
195 
198 
199  //helper functions to assist with the animation
202  virtual double altitude(const DtVector& geoPos);
204  virtual DtVector surfaceAt(const DtVector& geoPos);
206  virtual DtVector clampAltitude(const DtVector& geoPos);
209  virtual DtVector bounce(double dt, DtVector start, DtVector end);
213  virtual double altitudeContrib();
217  virtual double phase1Contrib(double t);
221  virtual double phase3Contrib(double t);
224  virtual double calculatePercentage(double s, double e, double t);
227  virtual double calculateEasedPercent(double t);
228  };
229 } //makVrv::

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)