VR-Forces 4.3.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
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
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
161
//these are all geocentric locations
162
DtVector
myStartPosition
;
163
DtVector
myPreviousPosition
;
164
DtVector
myCurrentPosition
;
165
DtVector
myEndPosition
;
166
DtVector
myOffsetPosition
;
167
168
DtVector
myUpVector
;
169
170
//these are IG orientations
171
DtQuat
myStartOrientation
;
172
DtQuat
myCurrentOrientation
;
173
DtQuat
myEndOrienation
;
174
DtQuat
myOffsetOrientation
;
175
176
//for trying to find a target location when the attachment point is on
177
//a moving target
178
DtVector
myTargetPosition
;
179
DtQuat
myTargetOrientation
;
180
181
//Animator needs to know if it is a 2D mode so it can use view resolution instead of zoom
182
bool
myIs2DObsMode
;
183
184
double
myStartZoom
;
185
double
myCurrentZoom
;
186
double
myEndZoom
;
187
188
double
myStartTime
;
189
double
myCurrentTime
;
190
double
myEndTime
;
191
192
double
myTravelDistance
;
193
double
myCurrentAltitude
;
194
195
bool
myShouldUseVelocity
;
196
bool
myShouldFaceEarth
;
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
)