mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-11-18 09:46:19 -06:00
MathUtil: C++20/23 modernisations
I've also created DegreesToRadians/RadiansToDegrees utility functions since there was a lot of repeated code
This commit is contained in:
@@ -538,7 +538,7 @@ bool evdevDevice::AddNode(std::string devnode, int fd, libevdev* dev)
|
||||
// evdev resolution is specified in "g"s and deg/s.
|
||||
// Convert these to m/s/s and rad/s.
|
||||
constexpr ControlState accel_scale = MathUtil::GRAVITY_ACCELERATION;
|
||||
constexpr ControlState gyro_scale = MathUtil::TAU / 360;
|
||||
constexpr ControlState gyro_scale = MathUtil::DegreesToRadians(ControlState{1});
|
||||
|
||||
add_motion_inputs(ABS_X, accel_scale);
|
||||
add_motion_inputs(ABS_RX, gyro_scale);
|
||||
|
||||
Reference in New Issue
Block a user