JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
FGSurface.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGSurface.h
4  Author: Erik Hofman
5  Date started: 01/15/14
6 
7  ------------- Copyright (C) 2014 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 01/15/14 EMH Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGSURFACE_H
35 #define FGSURFACE_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include "FGFDMExec.h"
42 
43 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44 FORWARD DECLARATIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 namespace JSBSim {
48 
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 CLASS DOCUMENTATION
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52 
57 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 CLASS DECLARATION
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
60 
61 class FGSurface
62 {
63 public:
64 
65  enum ContactType {ctBOGEY, ctSTRUCTURE, ctGROUND};
66 
68  FGSurface(FGFDMExec* fdmex, int number = -1);
69 
71  ~FGSurface();
72 
73  void bind(void);
74 
76  void resetValues(void);
77 
79  void SetStaticFFactor(double friction) { staticFFactor = friction; }
80 
82  void SetRollingFFactor(double friction) { rollingFFactor = friction; }
83 
85  void SetMaximumForce(double force) { maximumForce = force; }
86 
88  void SetBumpiness(double bump) { bumpiness = bump; }
89 
91  void SetSolid(bool solid) { isSolid = solid; }
92 
94  void SetPosition(const double pt[3]) {
95  pos[0] = pt[0]; pos[1] = pt[1]; pos[2] = pt[2];
96  }
97 
98 
100  double GetStaticFFactor(void) { return staticFFactor; }
101 
103  double GetRollingFFactor(void) { return rollingFFactor; }
104 
106  double GetMaximumForce(void) { return maximumForce; }
107 
109  double GetBumpiness(void) { return bumpiness; }
110 
112  bool GetSolid(void) { return isSolid; }
113 
115  float GetBumpHeight();
116 
117  std::string GetSurfaceStrings(std::string delimeter) const;
118  std::string GetSurfaceValues(std::string delimeter) const;
119 
120 protected:
121  ContactType eSurfaceType;
122  double staticFFactor, rollingFFactor;
123  double maximumForce;
124  double bumpiness;
125  bool isSolid;
126 
127  double staticFCoeff, dynamicFCoeff;
128 
129 private:
130  int contactNumber;
131  double pos[3];
132 
133  FGPropertyManager* _PropertyManager;
134 
135  static std::string _CreateIndexedPropertyName(const std::string& Property, int index);
136 };
137 
138 }
139 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 #endif
JSBSim::FGSurface
Base class for all surface properties.
Definition: FGSurface.h:61
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGSurface::GetBumpiness
double GetBumpiness(void)
Gets the normalized bumpiness factor associated with the surface.
Definition: FGSurface.h:109
JSBSim::FGSurface::GetSolid
bool GetSolid(void)
Gets the surface is a solid flag value.
Definition: FGSurface.h:112
JSBSim::FGSurface::FGSurface
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition: FGSurface.cpp:52
JSBSim::FGSurface::SetMaximumForce
void SetMaximumForce(double force)
Sets the maximum force for the surface area.
Definition: FGSurface.h:85
JSBSim::FGSurface::GetMaximumForce
double GetMaximumForce(void)
Gets the maximum force of the surface area.
Definition: FGSurface.h:106
JSBSim::FGSurface::SetSolid
void SetSolid(bool solid)
Sets the surface is a solid flag value.
Definition: FGSurface.h:91
JSBSim::FGSurface::GetRollingFFactor
double GetRollingFFactor(void)
Gets the rolling friction factor of the surface area.
Definition: FGSurface.h:103
JSBSim::FGSurface::SetBumpiness
void SetBumpiness(double bump)
Sets the normalized bumpiness factor associated with the surface.
Definition: FGSurface.h:88
JSBSim::FGSurface::GetStaticFFactor
double GetStaticFFactor(void)
Gets the static friction factor of the surface area.
Definition: FGSurface.h:100
JSBSim::FGSurface::resetValues
void resetValues(void)
Reset all surface values to a default.
Definition: FGSurface.cpp:68
JSBSim::FGSurface::~FGSurface
~FGSurface()
Destructor.
Definition: FGSurface.cpp:62
JSBSim::FGSurface::SetPosition
void SetPosition(const double pt[3])
Set the currect position for bumpiness calulcation.
Definition: FGSurface.h:94
JSBSim::FGSurface::SetStaticFFactor
void SetStaticFFactor(double friction)
Sets the static friction factor of the surface area.
Definition: FGSurface.h:79
JSBSim::FGSurface::GetBumpHeight
float GetBumpHeight()
Returns the height of the bump at the provided offset.
Definition: FGSurface.cpp:117
JSBSim::FGPropertyManager
Definition: FGPropertyManager.h:373
JSBSim::FGSurface::SetRollingFFactor
void SetRollingFFactor(double friction)
Sets the rolling friction factor of the surface area.
Definition: FGSurface.h:82