FlightGear next
FGSurface.h
Go to the documentation of this file.
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
26HISTORY
27--------------------------------------------------------------------------------
2801/15/14 EMH Created
29
30%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31SENTRY
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34#ifndef FGSURFACE_H
35#define FGSURFACE_H
36
37/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38INCLUDES
39%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41#include "FGFDMExec.h"
42
43/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44FORWARD DECLARATIONS
45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47namespace JSBSim {
48
49/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50CLASS DOCUMENTATION
51%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52
56
57/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58CLASS DECLARATION
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
60
62{
63public:
64
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
99 void SetBumpHeight(float height) { bumpHeight = height; }
100
101
103 double GetStaticFFactor(void) { return staticFFactor; }
104
106 double GetRollingFFactor(void) { return rollingFFactor; }
107
109 double GetMaximumForce(void) { return maximumForce; }
110
112 double GetBumpiness(void) { return bumpiness; }
113
115 bool GetSolid(void) { return isSolid; }
116
118 float GetBumpHeight();
119
120 std::string GetSurfaceStrings(std::string delimeter) const;
121 std::string GetSurfaceValues(std::string delimeter) const;
122
123protected:
125 double staticFFactor = 1.0;
126 double rollingFFactor = 1.0;
127 double maximumForce = DBL_MAX;
128 double bumpiness = 0.0;
129 bool isSolid = true;
130
131 double staticFCoeff = 1.0;
132 double dynamicFCoeff = 1.0;
133
134private:
135 int contactNumber = 0;
136 double bumpHeight = DBL_MAX;
137 double pos[3] = { 0.0, 0.0, 0.0 };
138
139 FGPropertyManager* _PropertyManager = NULL;
140
141 static std::string _CreateIndexedPropertyName(const std::string& Property, int index);
142};
143
144}
145//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146#endif
void SetBumpiness(double bump)
Sets the normalized bumpiness factor associated with the surface.
Definition FGSurface.h:88
void SetBumpHeight(float height)
Sets the height of the bump at the provided offset.
Definition FGSurface.h:99
double GetBumpiness(void)
Gets the normalized bumpiness factor associated with the surface.
Definition FGSurface.h:112
double GetStaticFFactor(void)
Gets the static friction factor of the surface area.
Definition FGSurface.h:103
double rollingFFactor
Definition FGSurface.h:126
FGSurface(FGFDMExec *fdmex, int number=-1)
Constructor.
Definition FGSurface.cpp:52
std::string GetSurfaceValues(std::string delimeter) const
void SetStaticFFactor(double friction)
Sets the static friction factor of the surface area.
Definition FGSurface.h:79
double GetRollingFFactor(void)
Gets the rolling 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:82
~FGSurface()
Destructor.
Definition FGSurface.cpp:61
std::string GetSurfaceStrings(std::string delimeter) const
void SetMaximumForce(double force)
Sets the maximum force for the surface area.
Definition FGSurface.h:85
void SetPosition(const double pt[3])
Set the currect position for bumpiness calulcation.
Definition FGSurface.h:94
bool GetSolid(void)
Gets the surface is a solid flag value.
Definition FGSurface.h:115
float GetBumpHeight()
Returns the height of the bump at the provided offset.
ContactType eSurfaceType
Definition FGSurface.h:124
void resetValues(void)
Reset all surface values to a default.
Definition FGSurface.cpp:67
void SetSolid(bool solid)
Sets the surface is a solid flag value.
Definition FGSurface.h:91
void bind(void)
Definition FGSurface.cpp:81
double GetMaximumForce(void)
Gets the maximum force of the surface area.
Definition FGSurface.h:109