Implement analog triggers for DSUController (#239)

This commit is contained in:
capitalists 2022-09-10 23:32:17 +00:00 committed by GitHub
parent 3349d7b424
commit d4879da95c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,5 +164,8 @@ ControllerState DSUController::raw_state()
result.rotation.y = (float)state.data.ry / std::numeric_limits<uint8>::max();
result.rotation.y = (result.rotation.y * 2.0f) - 1.0f;
result.trigger.x = (float)state.data.l2 / std::numeric_limits<uint8>::max();
result.trigger.y = (float)state.data.r2 / std::numeric_limits<uint8>::max();
return result;
}