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
21 class Model : public BodyEnvironment {
27 Integrator* getIntegrator();
29 void setTurbulence(Turbulence* turb) { _turb = turb; }
32 void setState(State* s);
35 void setCrashed(bool crashed);
40 // Externally-managed subcomponents
41 int addThruster(Thruster* t);
42 int addSurface(Surface* surf);
43 int addRotorpart(Rotorpart* rpart);
44 int addRotorblade(Rotorblade* rblade);
45 int addRotor(Rotor* rotor);
46 int addGear(Gear* gear);
47 Surface* getSurface(int handle);
48 Rotorpart* getRotorpart(int handle);
49 Rotorblade* getRotorblade(int handle);
50 Rotor* getRotor(int handle);
51 Gear* getGear(int handle);
53 // Semi-private methods for use by the Airplane solver.
55 Thruster* getThruster(int handle);
56 void setThruster(int handle, Thruster* t);
58 void getThrust(float* out);
61 // Per-iteration settables
63 void setGroundPlane(double* planeNormal, double fromOrigin);
64 void setGroundEffect(float* pos, float span, float mul);
65 void setWind(float* wind);
66 void setAir(float pressure, float temp, float density);
68 // BodyEnvironment callbacks
69 virtual void calcForces(State* s);
70 virtual void newState(State* s);
73 void initRotorIteration();
74 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
75 float gearFriction(float wgt, float v, Gear* g);
76 float localGround(State* s, float* out);
77 void localWind(float* pos, State* s, float* out, float alt);
79 Integrator _integrator;
91 float _groundEffectSpan;
101 // Accumulators for the total internal gyro and engine torque
110 }; // namespace yasim