VR-Link API Documentation for HLA 1516
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 
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 
128  void input(const DtDcm & orient, const DtDirectedRotRate &drr,
129  DtTime simTime, int freeze=0);
130  void tick(DtTime simTime);
131 
132  const DtDcm & orientation() const { return myOs; }
133 
138  virtual void setSmoothEnable(int on);
139  virtual int smoothEnable() const;
140 
143  virtual void setSmoothPeriod(DtTime t);
144  virtual DtTime smoothPeriod() const;
145 
146 public:
147 
149  static void setDfltSmoothPeriod(DtTime t);
150  static DtTime dfltSmoothPeriod();
151 
153  static void setMasterSmoothEnable(bool onOff);
154  static bool masterSmoothEnable();
155 
156 protected:
157 
158  virtual void dfltAction(DtTime simTime, void *usr, DtDcm& os) = 0;
159  void init(void *u, DtTime t);
160  void setT1data();
161 
162 protected:
163 
164  int myFrozen;
165  DtTime myT0, myT2, myLastT;
168  DtDcm myOs, myO0;
170  int myEnable;
171  void *myUsr;
172 
173 protected:
174 
177 };
178 
179 
181 {
182  return *myTau;
183 }
184 
186 {
187  return *myTau;
188 }
189 
190 #endif /* _SMOOTHUTIL_H_ */
191 

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)