#ifndef _CONTROL_MAP_HPP
#define _CONTROL_MAP_HPP
-#include "util/Vector.hpp"
+#include "Vector.hpp"
namespace yasim {
public:
~ControlMap();
- enum OutputType { THROTTLE, MIXTURE, ADVANCE, REHEAT, PROP,
+ enum OutputType { THROTTLE, MIXTURE, STARTER, MAGNETOS,
+ ADVANCE, REHEAT, PROP,
BRAKE, STEER, EXTEND,
- INCIDENCE, FLAP0, FLAP1, SLAT, SPOILER };
+ INCIDENCE, FLAP0, FLAP1, SLAT, SPOILER, VECTOR,
+ BOOST };
- static const int OPT_SPLIT = 0x01;
- static const int OPT_INVERT = 0x02;
- static const int OPT_SQUARE = 0x04;
+ enum { OPT_SPLIT = 0x01,
+ OPT_INVERT = 0x02,
+ OPT_SQUARE = 0x04 };
// Returns a new, not-yet-used "input handle" for addMapping and
// setInput. This typically corresponds to one user axis.
// of object!
void addMapping(int input, int output, void* object, int options=0);
+ // An additional form to specify a mapping range. Input values
+ // outside of [src0:src1] are clamped, and are then mapped to
+ // [dst0:dst1] before being set on the object.
+ void addMapping(int input, int output, void* object, int options,
+ float src0, float src1, float dst0, float dst1);
+
// Resets our accumulated input values. Call before any
// setInput() invokations.
void reset();
void applyControls();
private:
- struct OutRec { int type; void* object; int n;
- float* values; Vector options; };
- struct MapRec { OutRec* out; int idx; };
+ struct OutRec { int type; void* object; Vector maps; };
+ struct MapRec { OutRec* out; int idx; int opt; float val;
+ float src0; float src1; float dst0; float dst1; };
// A list of (sub)Vectors containing a bunch of MapRec objects for
// each input handle.