public:
~ControlMap();
- enum OutputType { THROTTLE, MIXTURE, STARTER, MAGNETOS,
+ enum OutputType { THROTTLE, MIXTURE, CONDLEVER, STARTER, MAGNETOS,
ADVANCE, REHEAT, PROP,
- BRAKE, STEER, EXTEND,
+ BRAKE, STEER, EXTEND, HEXTEND, LEXTEND,
INCIDENCE, FLAP0, FLAP1, SLAT, SPOILER, VECTOR,
- BOOST };
+ BOOST, CASTERING, PROPPITCH, PROPFEATHER,
+ COLLECTIVE, CYCLICAIL, CYCLICELE, ROTORENGINEON,
+ REVERSE_THRUST, WASTEGATE };
enum { OPT_SPLIT = 0x01,
OPT_INVERT = 0x02,
void setInput(int input, float value);
// Calculates and applies the settings received since the last reset().
- void applyControls();
+ void applyControls(float dt);
+
+ // Returns the input/output range appropriate for the given
+ // control. Ailerons go from -1 to 1, while throttles are never
+ // lower than zero, etc...
+ static float rangeMin(int type);
+ static float rangeMax(int type);
+
+ // Each output record is identified by both an object/type tuple
+ // and a numeric handle.
+ int getOutputHandle(void* obj, int type);
+
+ // Sets the transition time for the control output to swing
+ // through its full range.
+ void setTransitionTime(int handle, float time);
+
+ // Retrieves the current value of the control output. Controls
+ // with OPT_SPLIT settable on inputs will have a separately
+ // computed "right side" value.
+ float getOutput(int handle);
+ float getOutputR(int handle);
private:
- struct OutRec { int type; void* object; Vector maps; };
+ struct OutRec { int type; void* object; Vector maps;
+ float oldL, oldR, time; };
struct MapRec { OutRec* out; int idx; int opt; float val;
float src0; float src1; float dst0; float dst1; };