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
DtVector
& vel,
const
DtVector
& 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
DtVector
& vel,
const
DtVector
& acc,
42
DtTime
simTime,
int
freeze=0);
43
void
tick
(
DtTime
simTime);
44
45
const
DtVector
&
position
()
const
{
return
ps; }
46
const
DtVector
&
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
DtVector
& 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,
vs
, p0, v0, dp, dv, p1, v1, a1, a2, ap;
99
int
myEnable
;
100
int
myNeedT1Data
;
101
int
myNeedT2Data
;
102
void
*
myUsr
;
103
104
protected
:
105
106
static
DtTime
theDfltTau
;
107
static
DtTime
theDfltHtau
;
108
static
DtTime
theDfltTauInv
;
109
static
bool
theMasterSmoothEnable
;
110
};
111
112
115
class
DT_DLL_VLPROTIND
DtSmoothOrient
116
{
117
public
:
118
121
DtSmoothOrient
(
void
*usr,
DtTime
smoothT,
122
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr);
124
DtSmoothOrient
(
void
*usr,
DtTime
smoothT);
125
126
virtual
~DtSmoothOrient
() {}
127
129
DtSmoothOrient
(
const
DtSmoothOrient
&);
130
132
DtSmoothOrient
& operator=(
const
DtSmoothOrient
&);
133
134
void
input(
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr,
135
DtTime
simTime,
int
freeze=0);
136
void
tick
(
DtTime
simTime);
137
138
const
DtDcm
&
orientation
()
const
{
return
myOs; }
139
144
virtual
void
setSmoothEnable(
int
on);
145
virtual
int
smoothEnable()
const
;
146
149
virtual
void
setSmoothPeriod(
DtTime
t);
150
virtual
DtTime
smoothPeriod()
const
;
151
154
virtual
void
reset();
155
156
public
:
157
159
static
void
setDfltSmoothPeriod(
DtTime
t);
160
static
DtTime
dfltSmoothPeriod();
161
163
static
void
setMasterSmoothEnable(
bool
onOff);
164
static
bool
masterSmoothEnable();
165
166
protected
:
167
168
virtual
void
dfltAction(
DtTime
simTime,
void
*usr,
DtDcm
& os) = 0;
169
void
init(
void
*u,
DtTime
t);
170
void
setT1data();
171
172
protected
:
173
174
int
myFrozen
;
175
DtTime
myT0,
myT2
, myLastT;
176
DtTime
*
myTau
;
177
DtTime
myLocalTau
;
178
DtDcm
myOs
, myO0;
179
DtVector
myWs
;
180
int
myEnable
;
181
void
*
myUsr
;
182
183
protected
:
184
185
static
DtTime
theDfltTau
;
186
static
bool
theMasterSmoothEnable
;
187
};
188
189
190
inline
DtTime
DtSmoothPos::smoothPeriod
()
const
191
{
192
return
*
myTau
;
193
}
194
195
inline
DtTime
DtSmoothOrient::smoothPeriod
()
const
196
{
197
return
*
myTau
;
198
}
199
200
#endif
/* _SMOOTHUTIL_H_ */
201
Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)