| 1 | /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 | |
| 3 | Header: FGSurface.h |
| 4 | Author: Erik Hofman |
| 5 | Date started: 01/15/14 |
| 6 | |
| 7 | ------------- Copyright (C) 2014 Jon S. Berndt ([email protected]) ------------- |
| 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 | |
| 53 | /** Base class for all surface properties |
| 54 | @author Erik M. Hofman |
| 55 | */ |
| 56 | |
| 57 | /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 58 | CLASS DECLARATION |
| 59 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ |
| 60 | |
| 61 | class FGSurface |
| 62 | { |
| 63 | public: |
| 64 | /// Constructor |
| 65 | FGSurface(FGFDMExec* fdmex); |
| 66 | |
| 67 | void bind(FGPropertyManager* pm); |
| 68 | |
| 69 | /// Reset all surface values to a default |
| 70 | void resetValues(void); |
| 71 | |
| 72 | /// Sets the static friction factor of the surface area |
| 73 | void SetStaticFFactor(double friction) { staticFFactor = friction; } |
| 74 | |
| 75 | /// Sets the rolling friction factor of the surface area |
| 76 | void SetRollingFFactor(double friction) { rollingFFactor = friction; } |
| 77 | |
| 78 | /// Sets the maximum force for the surface area |
| 79 | void SetMaximumForce(double force) { maximumForce = force; } |
| 80 | |
| 81 | /// Sets the normalized bumpiness factor associated with the surface |
| 82 | void SetBumpiness(double bump) { bumpiness = bump; } |
| 83 | |
| 84 | /// Sets the surface is a solid flag value |
| 85 | void SetSolid(bool solid) { isSolid = solid; } |
| 86 | |
| 87 | /// Set the currect position for bumpiness calulcation |
| 88 | void SetPosition(const double pt[3]) { |
| 89 | pos[0] = pt[0]; pos[1] = pt[1]; pos[2] = pt[2]; |
| 90 | } |
| 91 | |
| 92 | |
| 93 | /// Gets the static friction factor of the surface area |
| 94 | double GetStaticFFactor(void) { return staticFFactor; } |
| 95 | |
| 96 | /// Gets the rolling friction factor of the surface area |
| 97 | double GetRollingFFactor(void) { return rollingFFactor; } |
| 98 | |
| 99 | /// Gets the maximum force of the surface area |
| 100 | double GetMaximumForce(void) { return maximumForce; } |
| 101 | |
| 102 | /// Gets the normalized bumpiness factor associated with the surface |
| 103 | double GetBumpiness(void) { return bumpiness; } |
| 104 | |
| 105 | /// Gets the surface is a solid flag value |
| 106 | bool GetSolid(void) { return isSolid; } |
| 107 | |
| 108 | /// Returns the height of the bump at the provided offset |
| 109 | float GetBumpHeight(); |
| 110 | |
| 111 | protected: |
| 112 | double staticFFactor, rollingFFactor; |
| 113 | double maximumForce; |
| 114 | double bumpiness; |
| 115 | bool isSolid; |
| 116 | |
| 117 | private: |
| 118 | double pos[3]; |
| 119 | }; |
| 120 | |
| 121 | } |
| 122 | //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 123 | #endif |