4 #include "Integrator.hpp"
5 #include "RigidBody.hpp"
6 #include "BodyEnvironment.hpp"
11 // Declare the types whose pointers get passed around here
20 class Model : public BodyEnvironment {
26 Integrator* getIntegrator();
29 void setState(State* s);
33 void setCrashed(bool crashed);
36 void iterate(float dt);
38 // Externally-managed subcomponents
39 int addThruster(Thruster* t);
40 int addSurface(Surface* surf);
41 int addRotorpart(Rotorpart* rpart);
42 int addRotorblade(Rotorblade* rblade);
43 int addRotor(Rotor* rotor);
44 int addGear(Gear* gear);
45 Surface* getSurface(int handle);
46 Rotorpart* getRotorpart(int handle);
47 Rotorblade* getRotorblade(int handle);
48 Rotor* getRotor(int handle);
49 Gear* getGear(int handle);
51 // Semi-private methods for use by the Airplane solver.
53 Thruster* getThruster(int handle);
54 void setThruster(int handle, Thruster* t);
55 void initIteration(float dt);
56 void getThrust(float* out);
59 // Per-iteration settables
61 void setGroundPlane(double* planeNormal, double fromOrigin);
62 void setGroundEffect(float* pos, float span, float mul);
63 void setWind(float* wind);
64 void setAir(float pressure, float temp, float density);
66 // BodyEnvironment callbacks
67 virtual void calcForces(State* s);
68 virtual void newState(State* s);
71 void calcGearForce(Gear* g, float* v, float* rot, float* ground);
72 float gearFriction(float wgt, float v, Gear* g);
73 float localGround(State* s, float* out);
74 void localWind(float* pos, State* s, float* out);
76 Integrator _integrator;
86 float _groundEffectSpan;
96 // Accumulators for the total internal gyro and engine torque
105 }; // namespace yasim