VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvCore
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
>
15
#include <
vrvCore/DtObserverObject.h
>
16
17
18
#include <
makArchives/DtObserverStateRecord.h
>
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
37
class
DT_DLL_VRVCORE
DtObserverAnimator
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
58
DtObserverAnimator
(
DtDe
& de,
DtObserver
& obs,
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
;
81
DtUniqueID
elementId
;
82
DtVector
geoPos
;
83
DtTaitBryan
geoOri
;
84
DtVector
cigPos
;
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
148
DtEaser
*
myEaser
;
149
150
makVrv::DtDe
&
myDe
;
151
makVrv::DtObserver
&
myObserver
;
152
float
mySmoothTime
;
153
154
bool
myIsDone
;
155
156
DtObserverObject::AttachType
myAttachType
;
157
bool
myIsAttached
;
158
DtUniqueID
myAttachedTo
;
159
DtUniqueID
mySecondaryAttachedTo
;
160
DtVector
myLocationTrackAttachment
;
161
162
//these are all geocentric locations
163
DtVector
myStartPosition
;
164
DtVector
myPreviousPosition
;
165
DtVector
myCurrentPosition
;
166
DtVector
myEndPosition
;
167
DtVector
myOffsetPosition
;
168
169
DtVector
myUpVector
;
170
171
//these are IG orientations
172
DtQuat
myStartOrientation
;
173
DtQuat
myCurrentOrientation
;
174
DtQuat
myEndOrienation
;
175
DtQuat
myOffsetOrientation
;
176
177
//for trying to find a target location when the attachment point is on
178
//a moving target
179
DtVector
myTargetPosition
;
180
DtQuat
myTargetOrientation
;
181
182
//Animator needs to know if it is a 2D mode so it can use view resolution instead of zoom
183
bool
myIs2DObsMode
;
184
185
double
myStartZoom
;
186
double
myCurrentZoom
;
187
double
myEndZoom
;
188
189
double
myStartTime
;
190
double
myCurrentTime
;
191
double
myEndTime
;
192
193
double
myTravelDistance
;
194
double
myCurrentAltitude
;
195
196
bool
myShouldUseVelocity
;
197
bool
myShouldFaceEarth
;
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 Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)