4 #include "Integrator.hpp"
5 #include "RigidBody.hpp"
6 #include "BodyEnvironment.hpp"
7 #include "util/Vector.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.
38 Thruster* getThruster(int handle);
39 void setThruster(int handle, Thruster* t);
41 void getThrust(float* out);
44 // Per-iteration settables
46 void setGroundPlane(double* planeNormal, double fromOrigin);
47 void setWind(float* wind);
48 void setAirDensity(float rho);
49 void setAir(float pressure, float temp);
51 // BodyEnvironment callbacks
52 virtual void calcForces(State* s);
53 virtual void newState(State* s);
56 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
57 float gearFriction(float wgt, float v, Gear* g);
58 float localGround(State* s, float* out);
59 void localWind(float* pos, State* s, float* out);
61 Integrator _integrator;
72 // Accumulators for the total internal gyro and engine torque