mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Gamepad and joystick dead zone fix
Fix for gamepad and joystick dead zone calculation so that the calculated value will always fall within the 0..1 range. In reference to https://github.com/GarageGames/Torque3D/issues/468
This commit is contained in:
parent
599738477e
commit
2c0fcaa398
1 changed files with 2 additions and 2 deletions
|
|
@ -1508,9 +1508,9 @@ bool ActionMap::processAction(const InputEventInfo* pEvent)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( value > 0 )
|
if( value > 0 )
|
||||||
value = ( value - pNode->deadZoneBegin ) * ( 1.f / ( 1.f - pNode->deadZoneBegin ) );
|
value = ( value - pNode->deadZoneEnd ) * ( 1.f / ( 1.f - pNode->deadZoneEnd ) );
|
||||||
else
|
else
|
||||||
value = ( value + pNode->deadZoneBegin ) * ( 1.f / ( 1.f - pNode->deadZoneBegin ) );
|
value = ( value - pNode->deadZoneBegin ) * ( 1.f / ( 1.f + pNode->deadZoneBegin ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue