Tweak default accelerometer sensitivity.
Also move it to the config file.
This commit is contained in:
parent
590ec78640
commit
b820a60e98
@ -436,6 +436,11 @@ namespace UserConfigParams
|
||||
"A parameter in range [0, 0.5] that determines the zone that is "
|
||||
"considered as max value in steering button."));
|
||||
|
||||
PARAM_PREFIX FloatUserConfigParam m_multitouch_tilt_factor
|
||||
PARAM_DEFAULT( FloatUserConfigParam(4.0f, "multitouch_tilt_factor",
|
||||
&m_multitouch_group,
|
||||
"A parameter that determines general accelerometer sensitivity."));
|
||||
|
||||
PARAM_PREFIX FloatUserConfigParam m_multitouch_scale
|
||||
PARAM_DEFAULT( FloatUserConfigParam(1.1f, "multitouch_scale",
|
||||
&m_multitouch_group,
|
||||
|
@ -1192,14 +1192,17 @@ EventPropagation InputManager::input(const SEvent& event)
|
||||
if (button->type != BUTTON_STEERING)
|
||||
continue;
|
||||
|
||||
float factor = UserConfigParams::m_multitouch_tilt_factor;
|
||||
factor = std::max(factor, 0.1f);
|
||||
|
||||
if (UserConfigParams::m_multitouch_accelerometer == 1)
|
||||
{
|
||||
button->axis_x = (float)-event.AccelerometerEvent.X / 5.0f;
|
||||
button->axis_x = (float)-event.AccelerometerEvent.X / factor;
|
||||
device->handleControls(button);
|
||||
}
|
||||
else if (UserConfigParams::m_multitouch_accelerometer == 2)
|
||||
{
|
||||
button->axis_x = (float)event.AccelerometerEvent.Y / 5.0f;
|
||||
button->axis_x = (float)event.AccelerometerEvent.Y / factor;
|
||||
device->handleControls(button);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user