4 #include "Integrator.hpp"
5 #include "RigidBody.hpp"
6 #include "BodyEnvironment.hpp"
8 #include "Turbulence.hpp"
13 // Declare the types whose pointers get passed around here
23 class Model : public BodyEnvironment {
29 Integrator* getIntegrator();
31 void setTurbulence(Turbulence* turb) { _turb = turb; }
34 void setState(State* s);
37 void setCrashed(bool crashed);
42 // Externally-managed subcomponents
43 int addThruster(Thruster* t);
44 int addSurface(Surface* surf);
45 int addGear(Gear* gear);
46 void addHook(Hook* hook);
47 void addLaunchbar(Launchbar* launchbar);
48 Surface* getSurface(int handle);
49 Rotorgear* getRotorgear(void);
50 Gear* getGear(int handle);
52 Launchbar* getLaunchbar(void);
54 // Semi-private methods for use by the Airplane solver.
56 Thruster* getThruster(int handle);
57 void setThruster(int handle, Thruster* t);
59 void getThrust(float* out);
61 void setGroundCallback(Ground* ground_cb);
62 Ground* getGroundCallback(void);
65 // Per-iteration settables
67 void setGroundEffect(float* pos, float span, float mul);
68 void setWind(float* wind);
69 void setAir(float pressure, float temp, float density);
71 void updateGround(State* s);
73 // BodyEnvironment callbacks
74 virtual void calcForces(State* s);
75 virtual void newState(State* s);
78 void initRotorIteration();
79 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
80 float gearFriction(float wgt, float v, Gear* g);
81 void localWind(float* pos, State* s, float* out, float alt,
82 bool is_rotor = false);
84 Integrator _integrator;
94 Launchbar* _launchbar;
96 float _groundEffectSpan;
101 double _global_ground[4];
107 // Accumulators for the total internal gyro and engine torque
116 }; // namespace yasim