2001-12-01 06:22:24 +00:00
|
|
|
#ifndef _THRUSTER_HPP
|
|
|
|
#define _THRUSTER_HPP
|
|
|
|
|
|
|
|
namespace yasim {
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
class Jet;
|
|
|
|
class PropEngine;
|
|
|
|
class Propeller;
|
|
|
|
class PistonEngine;
|
|
|
|
|
2001-12-01 06:22:24 +00:00
|
|
|
class Thruster {
|
|
|
|
public:
|
|
|
|
Thruster();
|
|
|
|
virtual ~Thruster();
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
// Typing info, these are the possible sub-type (or sub-parts)
|
|
|
|
// that a thruster might have. Any might return null. A little
|
|
|
|
// clumsy, but much simpler than an RTTI-based implementation.
|
|
|
|
virtual Jet* getJet() { return 0; }
|
|
|
|
virtual PropEngine* getPropEngine() { return 0; }
|
|
|
|
virtual Propeller* getPropeller() { return 0; }
|
|
|
|
virtual PistonEngine* getPistonEngine() { return 0; }
|
|
|
|
|
2001-12-01 06:22:24 +00:00
|
|
|
// Static data
|
|
|
|
void getPosition(float* out);
|
|
|
|
void setPosition(float* pos);
|
|
|
|
void getDirection(float* out);
|
|
|
|
void setDirection(float* dir);
|
|
|
|
|
|
|
|
// Controls
|
|
|
|
void setThrottle(float throttle);
|
|
|
|
void setMixture(float mixture);
|
2002-02-20 04:27:22 +00:00
|
|
|
void setStarter(bool starter);
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
// Dynamic output
|
2002-02-20 04:27:22 +00:00
|
|
|
virtual bool isRunning()=0;
|
|
|
|
virtual bool isCranking()=0;
|
2001-12-01 06:22:24 +00:00
|
|
|
virtual void getThrust(float* out)=0;
|
|
|
|
virtual void getTorque(float* out)=0;
|
|
|
|
virtual void getGyro(float* out)=0;
|
|
|
|
virtual float getFuelFlow()=0;
|
|
|
|
|
|
|
|
// Runtime instructions
|
|
|
|
void setWind(float* wind);
|
2001-12-06 18:13:24 +00:00
|
|
|
void setAir(float pressure, float temp);
|
2002-02-27 00:41:57 +00:00
|
|
|
virtual void init() {}
|
2001-12-01 06:22:24 +00:00
|
|
|
virtual void integrate(float dt)=0;
|
2001-12-06 18:13:24 +00:00
|
|
|
virtual void stabilize()=0;
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
float _pos[3];
|
|
|
|
float _dir[3];
|
|
|
|
float _throttle;
|
|
|
|
float _mixture;
|
2002-02-20 04:27:22 +00:00
|
|
|
bool _starter; // true=engaged, false=disengaged
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
float _wind[3];
|
2001-12-07 20:00:59 +00:00
|
|
|
float _pressure;
|
|
|
|
float _temp;
|
2001-12-01 06:22:24 +00:00
|
|
|
float _rho;
|
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace yasim
|
|
|
|
#endif // _THRUSTER_HPP
|
|
|
|
|