4 #include "Integrator.hpp"
5 #include "RigidBody.hpp"
6 #include "BodyEnvironment.hpp"
8 #include "Turbulence.hpp"
12 // 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 addRotorpart(Rotorpart* rpart);
47 int addRotorblade(Rotorblade* rblade);
48 int addRotor(Rotor* rotor);
49 int addGear(Gear* gear);
50 void addHook(Hook* hook);
51 void addLaunchbar(Launchbar* launchbar);
52 Surface* getSurface(int handle);
53 Rotorpart* getRotorpart(int handle);
54 Rotorblade* getRotorblade(int handle);
55 Rotor* getRotor(int handle);
56 Gear* getGear(int handle);
58 Launchbar* getLaunchbar(void);
60 // Semi-private methods for use by the Airplane solver.
62 Thruster* getThruster(int handle);
63 void setThruster(int handle, Thruster* t);
65 void getThrust(float* out);
67 void setGroundCallback(Ground* ground_cb);
68 Ground* getGroundCallback(void);
71 // Per-iteration settables
73 void setGroundEffect(float* pos, float span, float mul);
74 void setWind(float* wind);
75 void setAir(float pressure, float temp, float density);
77 void updateGround(State* s);
79 // BodyEnvironment callbacks
80 virtual void calcForces(State* s);
81 virtual void newState(State* s);
84 void initRotorIteration();
85 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
86 float gearFriction(float wgt, float v, Gear* g);
87 void localWind(float* pos, State* s, float* out, float alt);
89 Integrator _integrator;
101 Launchbar* _launchbar;
103 float _groundEffectSpan;
105 float _wingCenter[3];
108 double _global_ground[4];
114 // Accumulators for the total internal gyro and engine torque
123 }; // namespace yasim