mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-10-23 05:30:39 +02: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:
parent
94e9c2bd74
commit
7b750bf5bb
6 changed files with 35 additions and 58 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue