#include <FGExternalReactions.h>
Inherits FGModel.
This class acts similarly to the other "manager classes" (FGPropulsion, FGFCS, FGGroundReactions, FGAerodynamics) because it manages collections of constituent forces. The individual forces are implemented with the FGExternalForce class.
The format of the optional external reactions section in the config file is as follows:
<external_reactions> <!-- Interface properties, a.k.a. property declarations --> <property> ... </property> <force name="name" frame="BODY | LOCAL | WIND" unit="unit"> ... </force> <!-- Additional force definitions may follow --> <force name="name" frame="BODY | LOCAL | WIND" unit="unit"> ... </force> </external_reactions>
See the FGExternalForce class for more information on the format of the force specification itself.
When force elements are encountered in the configuration file, a new instance of the FGExternalForce class is created and a pointer to the class is pushed onto the Forces vector.
This class is one of a few of the manager classes that allows properties to be "declared". In code, these are represented by the interface_properties vector. Properties that have not yet been created in an already parsed section of the configuration file and that are used in the definition of an external force should be declared in the external_reactions section because they will not be created automatically, and so would cause an error, since the property cannot be found to exist.
See the FGExternalForce documentation for details on how forces are actually calculated.
Definition at line 116 of file FGExternalReactions.h.
Public Member Functions | |
| FGExternalReactions (FGFDMExec *fdmex) | |
| Constructor. | |
| FGColumnVector3 | GetForces (void) |
| Retrieves the total forces defined in the external reactions. | |
| FGColumnVector3 | GetMoments (void) |
| Retrieves the total moment resulting from the forces defined in the external reactions. | |
| bool | InitModel (void) |
| bool | Load (Element *el) |
| Loads the external forces from the XML configuration file. | |
| bool | Run (void) |
| Sum all the constituent forces for this cycle. | |
| ~FGExternalReactions (void) | |
| Destructor. | |
| FGExternalReactions | ( | FGFDMExec * | fdmex | ) |
| fdmex | pointer to the main executive class. |
Definition at line 59 of file FGExternalReactions.cpp.
| ~FGExternalReactions | ( | void | ) |
Within the destructor the Forces and interface_properties vectors are cleared out and the items pointed to are deleted.
Definition at line 106 of file FGExternalReactions.cpp.
| FGColumnVector3 GetForces | ( | void | ) | [inline] |
| FGColumnVector3 GetMoments | ( | void | ) | [inline] |
| bool Load | ( | Element * | el | ) | [virtual] |
If the external_reactions section is encountered in the vehicle configuration file, this Load() method is called. All external forces will be parsed, and a FGExternalForce object will be instantiated for each force definition.
| el | a pointer to the XML element holding the external reactions definition. |
Reimplemented from FGModel.
Definition at line 67 of file FGExternalReactions.cpp.
| bool Run | ( | void | ) | [virtual] |
Reimplemented from FGModel.
Definition at line 126 of file FGExternalReactions.cpp.
1.5.5