mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-16 05:21:22 +00:00
[hid_core, input_common] use std::numbers::pi{_v} instead of re-defining (#4160)
don't reinvent the wheel, simple as that. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4160 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
// SPDX-FileCopyrightText: 2018 Citra Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <numbers>
|
||||
#include "common/logging.h"
|
||||
#include "common/math_util.h"
|
||||
#include "common/param_package.h"
|
||||
@@ -146,9 +148,9 @@ public:
|
||||
break;
|
||||
}
|
||||
case SDL_SENSOR_GYRO: {
|
||||
motion.gyro_x = event.data[0] / (Common::PI * 2);
|
||||
motion.gyro_y = -event.data[2] / (Common::PI * 2);
|
||||
motion.gyro_z = event.data[1] / (Common::PI * 2);
|
||||
motion.gyro_x = event.data[0] / (f32(std::numbers::pi_v<float>) * 2);
|
||||
motion.gyro_y = -event.data[2] / (f32(std::numbers::pi_v<float>) * 2);
|
||||
motion.gyro_z = event.data[1] / (f32(std::numbers::pi_v<float>) * 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user