VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
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 
90 
97 
98  DtVector ps, vs, p0, v0, dp, dv, p1, v1, a1, a2, ap;
99  int myEnable;
102  void *myUsr;
103 
104 protected:
105 
110 };
111 
112 
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 
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;
178  DtDcm myOs, myO0;
180  int myEnable;
181  void *myUsr;
182 
183 protected:
184 
187 };
188 
189 
191 {
192  return *myTau;
193 }
194 
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)