Skip to content
Snippets Groups Projects
Unverified Commit 98913986 authored by bunnei's avatar bunnei Committed by GitHub
Browse files

Merge pull request #4621 from Morph1984/use-pi

input_common/motion_input: Make use of Common::PI constant
parents f64917a8 45ecd601
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace Common { namespace Common {
constexpr float PI = 3.14159265f; constexpr float PI = 3.1415926535f;
template <class T> template <class T>
struct Rectangle { struct Rectangle {
......
// Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included
#include "common/math_util.h"
#include "input_common/motion_input.h" #include "input_common/motion_input.h"
namespace InputCommon { namespace InputCommon {
...@@ -69,7 +74,7 @@ void MotionInput::UpdateOrientation(u64 elapsed_time) { ...@@ -69,7 +74,7 @@ void MotionInput::UpdateOrientation(u64 elapsed_time) {
} }
const auto normal_accel = accel.Normalized(); const auto normal_accel = accel.Normalized();
auto rad_gyro = gyro * 3.1415926535f * 2; auto rad_gyro = gyro * Common::PI * 2;
const f32 swap = rad_gyro.x; const f32 swap = rad_gyro.x;
rad_gyro.x = rad_gyro.y; rad_gyro.x = rad_gyro.y;
rad_gyro.y = -swap; rad_gyro.y = -swap;
......
// Copyright 2014 Dolphin Emulator Project // Copyright 2020 yuzu Emulator Project
// Licensed under GPLv2+ // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included
#pragma once #pragma once
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment