VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vlpi
smoothUtil.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*********************************************************************/
5
6
9
10
#ifndef DtSmoothPos_H_
11
#define DtSmoothPos_H_
12
13
#include <
matrix/vlMath.h
>
14
#include <
matrix/vlDcm.h
>
15
#include <
matrix/vlVector.h
>
16
#include <
vlutil/vlTime.h
>
17
#include <
vlutil/vlPrint.h
>
18
20
class
DT_DLL_VLPROTIND
DtSmoothPos
21
{
22
public
:
23
26
DtSmoothPos
(
void
*usr,
DtTime
smoothT,
27
const
DtVector
& pos,
const
DtVector32
& vel,
const
DtVector32
& acc);
29
DtSmoothPos
(
void
*usr,
DtTime
smoothT);
30
31
virtual
~DtSmoothPos
() {}
32
34
DtSmoothPos
(
const
DtSmoothPos
&);
35
37
DtSmoothPos
& operator=(
const
DtSmoothPos
&);
38
39
public
:
40
41
void
input(
const
DtVector
& pos,
const
DtVector32
& vel,
const
DtVector32
& acc,
42
DtTime
simTime,
int
freeze=0);
43
void
tick
(
DtTime
simTime);
44
45
const
DtVector
&
position
()
const
{
return
ps; }
46
const
DtVector32
&
velocity
()
const
{
return
vs; }
47
52
virtual
void
setSmoothEnable(
int
on);
53
virtual
int
smoothEnable()
const
;
54
57
virtual
void
setSmoothPeriod(
DtTime
t);
58
virtual
DtTime
smoothPeriod()
const
;
59
62
virtual
void
reset();
63
64
public
:
65
67
static
void
setDfltSmoothPeriod(
DtTime
t);
68
static
DtTime
dfltSmoothPeriod();
69
71
static
void
setMasterSmoothEnable(
bool
onOff);
72
static
bool
masterSmoothEnable();
73
74
protected
:
75
76
77
virtual
void
dfltAction(
DtTime
simTime,
void
*usr,
78
DtVector32
& vs,
DtVector
& ps) = 0;
79
void
init(
void
*u,
DtTime
t);
80
void
setT1data();
81
82
protected
:
83
84
int
myFrozen
;
85
86
DtTime
myT0
;
87
DtTime
myT1
;
88
DtTime
myT2
;
89
DtTime
myLastT
;
90
91
DtTime
myLocalTau
;
92
DtTime
myLocalHtau
;
93
DtTime
myLocalTauInv
;
94
DtTime
*
myTau
;
95
DtTime
*
myHtau
;
96
DtTime
*
myTauInv
;
97
98
DtVector
ps
, p0, dp, p1;
99
DtVector32
vs
, v0, v1, dv;
100
DtVector32
a1, a2,
ap
;
101
int
myEnable
;
102
int
myNeedT1Data
;
103
int
myNeedT2Data
;
104
void
*
myUsr
;
105
106
protected
:
107
108
static
DtTime
theDfltTau
;
109
static
DtTime
theDfltHtau
;
110
static
DtTime
theDfltTauInv
;
111
static
bool
theMasterSmoothEnable
;
112
};
113
114
117
class
DT_DLL_VLPROTIND
DtSmoothOrient
118
{
119
public
:
120
123
DtSmoothOrient
(
void
*usr,
DtTime
smoothT,
124
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr);
126
DtSmoothOrient
(
void
*usr,
DtTime
smoothT);
127
128
virtual
~DtSmoothOrient
() {}
129
131
DtSmoothOrient
(
const
DtSmoothOrient
&);
132
134
DtSmoothOrient
& operator=(
const
DtSmoothOrient
&);
135
136
void
input(
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr,
137
DtTime
simTime,
int
freeze=0);
138
void
tick
(
DtTime
simTime);
139
140
const
DtDcm
&
orientation
()
const
{
return
myOs; }
141
146
virtual
void
setSmoothEnable(
int
on);
147
virtual
int
smoothEnable()
const
;
148
151
virtual
void
setSmoothPeriod(
DtTime
t);
152
virtual
DtTime
smoothPeriod()
const
;
153
156
virtual
void
reset();
157
158
public
:
159
161
static
void
setDfltSmoothPeriod(
DtTime
t);
162
static
DtTime
dfltSmoothPeriod();
163
165
static
void
setMasterSmoothEnable(
bool
onOff);
166
static
bool
masterSmoothEnable();
167
168
protected
:
169
170
virtual
void
dfltAction(
DtTime
simTime,
void
*usr,
DtDcm
& os) = 0;
171
void
init(
void
*u,
DtTime
t);
172
void
setT1data();
173
174
protected
:
175
176
int
myFrozen
;
177
DtTime
myT0,
myT2
, myLastT;
178
DtTime
*
myTau
;
179
DtTime
myLocalTau
;
180
DtDcm
myOs
, myO0;
181
DtVector
myWs
;
182
int
myEnable
;
183
void
*
myUsr
;
184
double
myPrecision
;
185
186
protected
:
187
188
static
DtTime
theDfltTau
;
189
static
bool
theMasterSmoothEnable
;
190
};
191
192
193
inline
DtTime
DtSmoothPos::smoothPeriod
()
const
194
{
195
return
*
myTau
;
196
}
197
198
inline
DtTime
DtSmoothOrient::smoothPeriod
()
const
199
{
200
return
*
myTau
;
201
}
202
203
#endif
/* _SMOOTHUTIL_H_ */
204
Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)