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);
32 void setCrashed(bool crashed);
37 // Externally-managed subcomponents
38 int addThruster(Thruster* t);
39 int addSurface(Surface* surf);
40 int addRotorpart(Rotorpart* rpart);
41 int addRotorblade(Rotorblade* rblade);
42 int addRotor(Rotor* rotor);
43 int addGear(Gear* gear);
44 Surface* getSurface(int handle);
45 Rotorpart* getRotorpart(int handle);
46 Rotorblade* getRotorblade(int handle);
47 Rotor* getRotor(int handle);
48 Gear* getGear(int handle);
50 // Semi-private methods for use by the Airplane solver.
52 Thruster* getThruster(int handle);
53 void setThruster(int handle, Thruster* t);
55 void getThrust(float* out);
58 // Per-iteration settables
60 void setGroundPlane(double* planeNormal, double fromOrigin);
61 void setGroundEffect(float* pos, float span, float mul);
62 void setWind(float* wind);
63 void setAir(float pressure, float temp, float density);
65 // BodyEnvironment callbacks
66 virtual void calcForces(State* s);
67 virtual void newState(State* s);
70 void initRotorIteration();
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