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
24 class Model : public BodyEnvironment {
30 Integrator* getIntegrator();
32 void setTurbulence(Turbulence* turb) { _turb = turb; }
35 void setState(State* s);
38 void setCrashed(bool crashed);
43 // Externally-managed subcomponents
44 int addThruster(Thruster* t);
45 int addSurface(Surface* surf);
46 int addGear(Gear* gear);
47 void addHook(Hook* hook);
48 void addLaunchbar(Launchbar* launchbar);
49 Surface* getSurface(int handle);
50 Rotorgear* getRotorgear(void);
51 Gear* getGear(int handle);
53 int addHitch(Hitch* hitch);
54 Launchbar* getLaunchbar(void);
56 // Semi-private methods for use by the Airplane solver.
58 Thruster* getThruster(int handle);
59 void setThruster(int handle, Thruster* t);
61 void getThrust(float* out);
63 void setGroundCallback(Ground* ground_cb);
64 Ground* getGroundCallback(void);
67 // Per-iteration settables
69 void setGroundEffect(float* pos, float span, float mul);
70 void setWind(float* wind);
71 void setAir(float pressure, float temp, float density);
73 void updateGround(State* s);
75 // BodyEnvironment callbacks
76 virtual void calcForces(State* s);
77 virtual void newState(State* s);
80 void initRotorIteration();
81 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
82 float gearFriction(float wgt, float v, Gear* g);
83 void localWind(float* pos, State* s, float* out, float alt,
84 bool is_rotor = false);
86 Integrator _integrator;
96 Launchbar* _launchbar;
99 float _groundEffectSpan;
101 float _wingCenter[3];
104 double _global_ground[4];
110 // Accumulators for the total internal gyro and engine torque
119 }; // namespace yasim