#include "RigidBody.hpp"
#include "BodyEnvironment.hpp"
#include "Vector.hpp"
+#include "Turbulence.hpp"
namespace yasim {
class Integrator;
class Thruster;
class Surface;
+class Rotorpart;
+class Rotorblade;
+class Rotor;
class Gear;
class Model : public BodyEnvironment {
RigidBody* getBody();
Integrator* getIntegrator();
+ void setTurbulence(Turbulence* turb) { _turb = turb; }
+
State* getState();
void setState(State* s);
+
bool isCrashed();
void setCrashed(bool crashed);
float getAGL();
// Externally-managed subcomponents
int addThruster(Thruster* t);
int addSurface(Surface* surf);
+ int addRotorpart(Rotorpart* rpart);
+ int addRotorblade(Rotorblade* rblade);
+ int addRotor(Rotor* rotor);
int addGear(Gear* gear);
Surface* getSurface(int handle);
+ Rotorpart* getRotorpart(int handle);
+ Rotorblade* getRotorblade(int handle);
+ Rotor* getRotor(int handle);
Gear* getGear(int handle);
// Semi-private methods for use by the Airplane solver.
virtual void newState(State* s);
private:
+ void initRotorIteration();
void calcGearForce(Gear* g, float* v, float* rot, float* ground);
float gearFriction(float wgt, float v, Gear* g);
float localGround(State* s, float* out);
- void localWind(float* pos, State* s, float* out);
+ void localWind(float* pos, State* s, float* out, float alt);
Integrator _integrator;
RigidBody _body;
+ Turbulence* _turb;
+
Vector _thrusters;
Vector _surfaces;
+ Vector _rotorparts;
+ Vector _rotorblades;
+ Vector _rotors;
Vector _gears;
float _groundEffectSpan;