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);
30 // Externally-managed subcomponents
31 int addThruster(Thruster* t);
32 int addSurface(Surface* surf);
33 int addGear(Gear* gear);
34 Surface* getSurface(int handle);
35 Gear* getGear(int handle);
37 // Semi-private methods for use by the Airplane solver.
39 Thruster* getThruster(int handle);
40 void setThruster(int handle, Thruster* t);
42 void getThrust(float* out);
45 // Per-iteration settables
47 void setGroundPlane(double* planeNormal, double fromOrigin);
48 void setGroundEffect(float* pos, float span, float mul);
49 void setWind(float* wind);
50 void setAir(float pressure, float temp);
52 // BodyEnvironment callbacks
53 virtual void calcForces(State* s);
54 virtual void newState(State* s);
57 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
58 float gearFriction(float wgt, float v, Gear* g);
59 float localGround(State* s, float* out);
60 void localWind(float* pos, State* s, float* out);
62 Integrator _integrator;
69 float _groundEffectSpan;
79 // Accumulators for the total internal gyro and engine torque