JSBSim Flight Dynamics Model  1.0 (02 March 2017)
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 DEFINITIONS
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46 
47 #define ID_SURFACE "$Id: FGSurface.h,v 1.5 2014/01/28 09:42:21 ehofman Exp $"
48 
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 FORWARD DECLARATIONS
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52 
53 namespace JSBSim {
54 
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 CLASS DOCUMENTATION
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58 
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 CLASS DECLARATION
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
66 
67 class FGSurface
68 {
69 public:
70 
71  enum ContactType {ctBOGEY, ctSTRUCTURE, ctGROUND};
72 
74  FGSurface(FGFDMExec* fdmex, int number = -1);
75 
77  ~FGSurface();
78 
79  void bind(void);
80 
82  void resetValues(void);
83 
85  void SetStaticFFactor(double friction) { staticFFactor = friction; }
86 
88  void SetRollingFFactor(double friction) { rollingFFactor = friction; }
89 
91  void SetMaximumForce(double force) { maximumForce = force; }
92 
94  void SetBumpiness(double bump) { bumpiness = bump; }
95 
97  void SetSolid(bool solid) { isSolid = solid; }
98 
100  void SetPosition(const double pt[3]) {
101  pos[0] = pt[0]; pos[1] = pt[1]; pos[2] = pt[2];
102  }
103 
104 
106  double GetStaticFFactor(void) { return staticFFactor; }
107 
109  double GetRollingFFactor(void) { return rollingFFactor; }
110 
112  double GetMaximumForce(void) { return maximumForce; }
113 
115  double GetBumpiness(void) { return bumpiness; }
116 
118  bool GetSolid(void) { return isSolid; }
119 
121  float GetBumpHeight();
122 
123  std::string GetSurfaceStrings(std::string delimeter) const;
124  std::string GetSurfaceValues(std::string delimeter) const;
125 
126 protected:
127  ContactType eSurfaceType;
128  double staticFFactor, rollingFFactor;
129  double maximumForce;
130  double bumpiness;
131  bool isSolid;
132 
133  double staticFCoeff, dynamicFCoeff;
134 
135 private:
136  int contactNumber;
137  double pos[3];
138 
139  FGPropertyManager* _PropertyManager;
140 
141  static std::string _CreateIndexedPropertyName(const std::string& Property, int index);
142 };
143 
144 }
145 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 #endif
147 
double GetRollingFFactor(void)
Gets the rolling friction factor of the surface area.
Definition: FGSurface.h:109
double GetMaximumForce(void)
Gets the maximum force of the surface area.
Definition: FGSurface.h:112
void SetBumpiness(double bump)
Sets the normalized bumpiness factor associated with the surface.
Definition: FGSurface.h:94
void SetMaximumForce(double force)
Sets the maximum force for the surface area.
Definition: FGSurface.h:91
bool GetSolid(void)
Gets the surface is a solid flag value.
Definition: FGSurface.h:118
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition: FGSurface.cpp:59
double GetBumpiness(void)
Gets the normalized bumpiness factor associated with the surface.
Definition: FGSurface.h:115
float GetBumpHeight()
Returns the height of the bump at the provided offset.
Definition: FGSurface.cpp:121
double GetStaticFFactor(void)
Gets the static friction factor of the surface area.
Definition: FGSurface.h:106
void SetRollingFFactor(double friction)
Sets the rolling friction factor of the surface area.
Definition: FGSurface.h:88
void SetPosition(const double pt[3])
Set the currect position for bumpiness calulcation.
Definition: FGSurface.h:100
void SetSolid(bool solid)
Sets the surface is a solid flag value.
Definition: FGSurface.h:97
~FGSurface()
Destructor.
Definition: FGSurface.cpp:69
void resetValues(void)
Reset all surface values to a default.
Definition: FGSurface.cpp:75
Base class for all surface properties.
Definition: FGSurface.h:67
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
void SetStaticFFactor(double friction)
Sets the static friction factor of the surface area.
Definition: FGSurface.h:85