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 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 
90 
97 
98  DtVector ps, p0, dp, p1;
99  DtVector32 vs, v0, v1, dv;
100  DtVector32 a1, a2, ap;
101  int myEnable;
104  void *myUsr;
105 
106 protected:
107 
112 };
113 
114 
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 
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 
169  static void setDfltSmoothPrecision(double t);
170  static double dfltSmoothPrecision();
171 
172 protected:
173 
174  virtual void dfltAction(DtTime simTime, void *usr, DtDcm& os) = 0;
175  void init(void *u, DtTime t);
176  void setT1data();
177 
178 protected:
179 
180  int myFrozen;
181  DtTime myT0, myT2, myLastT;
184  DtDcm myOs, myO0;
186  int myEnable;
187  void *myUsr;
188  double myPrecision;
189 
190 protected:
191 
194  static double theDfltPrecision;
195 };
196 
197 
199 {
200  return *myTau;
201 }
202 
204 {
205  return *myTau;
206 }
207 
208 #endif /* _SMOOTHUTIL_H_ */
209 

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)