4 #include "Integrator.hpp"
5 #include "RigidBody.hpp"
6 #include "BodyEnvironment.hpp"
11 // Declare the types whose pointers get passed around here
17 class Model : public BodyEnvironment {
23 Integrator* getIntegrator();
26 void setState(State* s);
28 void setCrashed(bool crashed);
33 // Externally-managed subcomponents
34 int addThruster(Thruster* t);
35 int addSurface(Surface* surf);
36 int addGear(Gear* gear);
37 Surface* getSurface(int handle);
38 Gear* getGear(int handle);
40 // Semi-private methods for use by the Airplane solver.
42 Thruster* getThruster(int handle);
43 void setThruster(int handle, Thruster* t);
45 void getThrust(float* out);
48 // Per-iteration settables
50 void setGroundPlane(double* planeNormal, double fromOrigin);
51 void setGroundEffect(float* pos, float span, float mul);
52 void setWind(float* wind);
53 void setAir(float pressure, float temp, float density);
55 // BodyEnvironment callbacks
56 virtual void calcForces(State* s);
57 virtual void newState(State* s);
60 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
61 float gearFriction(float wgt, float v, Gear* g);
62 float localGround(State* s, float* out);
63 void localWind(float* pos, State* s, float* out);
65 Integrator _integrator;
72 float _groundEffectSpan;
82 // Accumulators for the total internal gyro and engine torque