]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGRotation.h
JSBSim tweaks.
[flightgear.git] / src / FDM / JSBSim / FGRotation.h
index f40d549307f428edd5fd987c8089dcdb486f91ab..3f64a254656dc28543a51c7aa687e9c3bb2d5de5 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGRotation.h
  Author:       Jon Berndt
@@ -27,9 +27,9 @@ HISTORY
 --------------------------------------------------------------------------------
 12/02/98   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES,  and NOTES
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
     Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420  Naval Postgraduate
     School, January 1994
@@ -45,67 +45,54 @@ COMMENTS, REFERENCES,  and NOTES
   The order of rotations used in this class corresponds to a 3-2-1 sequence,
   or Y-P-R, or Z-Y-X, if you prefer.
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGROTATION_H
 #define FGROTATION_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
-#  ifdef FG_HAVE_STD_INCLUDES
-#    include <cmath>
-#  else
-#    include <math.h>
-#  endif
+#  include <math.h>
 #else
 #  include <cmath>
 #endif
 
 #ifndef M_PI
 #  include <simgear/constants.h>
-#  define M_PI FG_PI
+#  define M_PI SG_PI
 #endif
 
 #include "FGModel.h"
 #include "FGMatrix.h"
 
-/*******************************************************************************
+#define ID_ROTATION "$Id$"
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 class FGRotation : public FGModel
 {
-  FGColumnVector vPQR;
-  FGColumnVector vPQRdot;
-  FGColumnVector vMoments;
-  FGColumnVector vEuler;
-  FGColumnVector vEulerRates;
-  
-  float cTht,sTht;
-  float cPhi,sPhi;
-  float cPsi,sPsi;
-  
-  float Ixx, Iyy, Izz, Ixz;
-  float dt;
-
-  void GetState(void);
-
 public:
   FGRotation(FGFDMExec*);
-  ~FGRotation(void);
+  ~FGRotation();
 
   bool Run(void);
 
   inline FGColumnVector GetPQR(void) {return vPQR;}
+  inline float GetPQR(int axis) {return vPQR(axis);}
   inline FGColumnVector GetPQRdot(void) {return vPQRdot;}
+  inline float GetPQRdot(int idx) {return vPQRdot(idx);}
   inline FGColumnVector GetEuler(void) {return vEuler;}
+  inline float GetEuler(int axis) {return vEuler(axis);}
   inline FGColumnVector GetEulerRates(void) { return vEulerRates; }
+  inline float GetEulerRates(int axis) { return vEulerRates(axis); }
   inline void SetPQR(FGColumnVector tt) {vPQR = tt;}
   inline void SetEuler(FGColumnVector tt) {vEuler = tt;}
   
@@ -121,9 +108,26 @@ public:
   inline float GetSintht(void) {return sTht;}
   inline float GetSinpsi(void) {return sPsi;}
 
+private:
+  FGColumnVector vPQR;
+  FGColumnVector vPQRdot;
+  FGColumnVector vMoments;
+  FGColumnVector vEuler;
+  FGColumnVector vEulerRates;
+  FGColumnVector vlastPQRdot;
+  
+  float cTht,sTht;
+  float cPhi,sPhi;
+  float cPsi,sPsi;
+  
+  float Ixx, Iyy, Izz, Ixz;
+  float dt;
 
+  void GetState(void);
 
+  void Debug(void);
 };
 
-/******************************************************************************/
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif
+