VR-Link API Documentation for HLA 1.3
 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 
19 
23 {
24 public:
25 
28  DtSmoothPos(void *usr, DtTime smoothT,
29  const DtVector& pos, const DtVector& vel, const DtVector& acc);
31  DtSmoothPos(void *usr, DtTime smoothT);
32 
33  virtual ~DtSmoothPos() {}
34 
35 private:
36 
38  DtSmoothPos(const DtSmoothPos&);
39 
41  DtSmoothPos& operator=(const DtSmoothPos&);
42 
43 public:
44 
45  void input(const DtVector& pos, const DtVector& vel, const DtVector& acc,
46  DtTime simTime, int freeze=0);
47  void tick(DtTime simTime);
48 
49  const DtVector& position() const { return ps; }
50  const DtVector& velocity() const { return vs; }
51 
56  virtual void setSmoothEnable(int on);
57  virtual int smoothEnable() const;
58 
61  virtual void setSmoothPeriod(DtTime t);
62  virtual DtTime smoothPeriod() const;
63 
66  virtual void reset();
67 
68 public:
69 
71  static void setDfltSmoothPeriod(DtTime t);
72  static DtTime dfltSmoothPeriod();
73 
75  static void setMasterSmoothEnable(bool onOff);
76  static bool masterSmoothEnable();
77 
78 protected:
79 
80 
81  virtual void dfltAction(DtTime simTime, void *usr,
82  DtVector& vs, DtVector& ps) = 0;
83  void init(void *u, DtTime t);
84  void setT1data();
85 
86 protected:
87 
88  int myFrozen;
89 
94 
101 
102  DtVector ps, vs, p0, v0, dp, dv, p1, v1, a1, a2, ap;
103  int myEnable;
106  void *myUsr;
107 
108 protected:
109 
114 };
115 
116 
120 {
121 public:
122 
125  DtSmoothOrient(void *usr, DtTime smoothT,
126  const DtDcm & orient, const DtDirectedRotRate &drr);
128  DtSmoothOrient(void *usr, DtTime smoothT);
129 
130  virtual ~DtSmoothOrient() {}
131 
132  void input(const DtDcm & orient, const DtDirectedRotRate &drr,
133  DtTime simTime, int freeze=0);
134  void tick(DtTime simTime);
135 
136  const DtDcm & orientation() const { return myOs; }
137 
142  virtual void setSmoothEnable(int on);
143  virtual int smoothEnable() const;
144 
147  virtual void setSmoothPeriod(DtTime t);
148  virtual DtTime smoothPeriod() const;
149 
152  virtual void reset();
153 
154 public:
155 
157  static void setDfltSmoothPeriod(DtTime t);
158  static DtTime dfltSmoothPeriod();
159 
161  static void setMasterSmoothEnable(bool onOff);
162  static bool masterSmoothEnable();
163 
164 protected:
165 
166  virtual void dfltAction(DtTime simTime, void *usr, DtDcm& os) = 0;
167  void init(void *u, DtTime t);
168  void setT1data();
169 
170 protected:
171 
172  int myFrozen;
173  DtTime myT0, myT2, myLastT;
176  DtDcm myOs, myO0;
178  int myEnable;
179  void *myUsr;
180 
181 protected:
182 
185 };
186 
187 
189 {
190  return *myTau;
191 }
192 
194 {
195  return *myTau;
196 }
197 
198 #endif /* _SMOOTHUTIL_H_ */
199 

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)