]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGLGear.h
Latest JSBSim changes, including some gear tweaking from Jon and some
[flightgear.git] / src / FDM / JSBSim / FGLGear.h
index 046853d5fb4718240d8267735416d7d32f411d77..1c4857b169fcfc9f2edce65f86a9c8f6342a1505 100644 (file)
@@ -44,8 +44,11 @@ INCLUDES
 
 #include <string>
 #include "FGConfigFile.h"
-#include "FGMatrix.h"
+#include "FGMatrix33.h"
+#include "FGColumnVector3.h"
+#include "FGColumnVector4.h"
 #include "FGFDMExec.h"
+#include "FGJSBBase.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -172,7 +175,7 @@ CLASS DOCUMENTATION
 CLASS DECLARATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-class FGLGear
+class FGLGear : public FGJSBBase
 {
 public:
   /// Brake grouping enumerators
@@ -191,27 +194,28 @@ public:
 
 
   /// The Force vector for this gear
-  FGColumnVector Force(void);
+  FGColumnVector3& Force(void);
   /// The Moment vector for this gear
-  FGColumnVector Moment(void) {return vMoment;}
+  FGColumnVector3& Moment(void) {return vMoment;}
 
   /// Gets the location of the gear in Body axes
-  FGColumnVector GetBodyLocation(void) { return vWhlBodyVec; }
-  float GetBodyLocation(int idx) { return vWhlBodyVec(idx); }
+  FGColumnVector3& GetBodyLocation(void) { return vWhlBodyVec; }
+  double GetBodyLocation(int idx) { return vWhlBodyVec(idx); }
 
-  FGColumnVector GetLocalGear(void) { return vLocalGear; }
-  float GetLocalGear(int idx) { return vLocalGear(idx); }
+  FGColumnVector3& GetLocalGear(void) { return vLocalGear; }
+  double GetLocalGear(int idx) { return vLocalGear(idx); }
 
   /// Gets the name of the gear
   inline string GetName(void)      {return name;          }
   /// Gets the Weight On Wheels flag value
   inline bool   GetWOW(void)       {return WOW;           }
   /// Gets the current compressed length of the gear in feet
-  inline float  GetCompLen(void)   {return compressLength;}
+  inline double  GetCompLen(void)   {return compressLength;}
   /// Gets the current gear compression velocity in ft/sec
-  inline float  GetCompVel(void)   {return compressSpeed; }
+  inline double  GetCompVel(void)   {return compressSpeed; }
   /// Gets the gear compression force in pounds
-  inline float  GetCompForce(void) {return Force()(3);    }
+  inline double  GetCompForce(void) {return Force()(3);    }
+  inline double  GetBrakeFCoeff(void) {return BrakeFCoeff;}
   
   /// Sets the brake value in percent (0 - 100)
   inline void SetBrake(double bp) {brakePct = bp;}
@@ -222,35 +226,53 @@ public:
   /** Get the console touchdown reporting feature
       @return true if reporting is turned on */
   inline bool GetReport(void)    { return ReportEnable; }
-
+  inline double GetSteerAngle(void) { return SteerAngle;}
+  inline double GetstaticFCoeff(void) { return staticFCoeff;}
+  
+  inline int GetBrakeGroup(void) { return (int)eBrakeGrp; }
+  inline int GetSteerType(void)  { return (int)eSteerType; }
+  
+  inline bool GetRetractable(void)  { return isRetractable; }
+  inline bool GetGearUnitUp(void)   { return GearUp; }
+  inline bool GetGearUnitDown(void) { return GearDown; }
+  
 private:
-  enum {eX=1, eY, eZ};
-  FGColumnVector vXYZ;
-  FGColumnVector vMoment;
-  FGColumnVector vWhlBodyVec;
-  FGColumnVector vLocalGear;
-  float kSpring;
-  float bDamp;
-  float compressLength;
-  float compressSpeed;
-  float staticFCoeff, dynamicFCoeff, rollingFCoeff;
-  float brakePct;
-  float maxCompLen;
+  FGColumnVector3 vXYZ;
+  FGColumnVector3 vMoment;
+  FGColumnVector3 vWhlBodyVec;
+  FGColumnVector3 vLocalGear;
+  FGColumnVector3 vForce;
+  FGColumnVector3 vLocalForce;
+  FGColumnVector3 vWhlVelVec;     // Velocity of this wheel (Local)
+  double SteerAngle;
+  double kSpring;
+  double bDamp;
+  double compressLength;
+  double compressSpeed;
+  double staticFCoeff, dynamicFCoeff, rollingFCoeff;
+  double brakePct;
+  double BrakeFCoeff;
+  double maxCompLen;
   double SinkRate;
   double GroundSpeed;
   double DistanceTraveled;
   double MaximumStrutForce;
   double MaximumStrutTravel;
   bool WOW;
+  bool lastWOW;
   bool FirstContact;
   bool Reported;
   bool ReportEnable;
+  bool isRetractable;
+  bool GearUp, GearDown;
   string name;
   string sSteerType;
   string sBrakeGroup;
+  string sRetractable;
+  
   BrakeGroup eBrakeGrp;
   SteerType  eSteerType;
-  float  maxSteerAngle;
+  double  maxSteerAngle;
 
   FGFDMExec*  Exec;
   FGState*    State;
@@ -261,7 +283,7 @@ private:
   FGMassBalance* MassBalance;
 
   void Report(void);
-  void Debug(void);
+  void Debug(int from);
 };
 
 #include "FGAircraft.h"