Two smooth controls can also be paired to each other. Motion on one control of
the pair will cause negative motion on the other. This works best when the
-controls are bound to the opposite sides of the same joystick axis.
+controls are bound to the opposite sides of the same axis.
*/
class SmoothControl: public Control
{
private:
float value;
SmoothControl *paired_ctrl;
+ float dead_zone;
+ float threshold;
public:
SmoothControl();
SmoothControl(const ControlSource &);
SmoothControl(Device &, ControlSrcType, unsigned);
- SmoothControl &operator=(const SmoothControl &);
virtual ~SmoothControl();
+ /// Sets the dead zone value. Any value below this will be treated as 0.
+ void set_dead_zone(float);
+
+ /// Sets the max-out threshold. Any value above this will be treated as 1.
+ void set_threshold(float);
+
void pair(SmoothControl *ctrl);
float get_value() const { return value; }