diff options
| author | 2020-09-02 11:58:15 -0400 | |
|---|---|---|
| committer | 2020-09-02 11:58:15 -0400 | |
| commit | 45ecd601be9519f6c969746c7736cb0a7090560a (patch) | |
| tree | 4c76baa8419fa8cb23c7c6ad2fa12a70d3c75426 | |
| parent | Merge pull request #4570 from german77/motionInput (diff) | |
| download | yuzu-45ecd601be9519f6c969746c7736cb0a7090560a.tar.gz yuzu-45ecd601be9519f6c969746c7736cb0a7090560a.tar.xz yuzu-45ecd601be9519f6c969746c7736cb0a7090560a.zip | |
input_common/motion_input: Make use of Common::PI constant
Also amend the copyright notice to yuzu's instead of Dolphin's, which was mistakenly copy-pasted from another file.
| -rw-r--r-- | src/common/math_util.h | 2 | ||||
| -rw-r--r-- | src/input_common/motion_input.cpp | 7 | ||||
| -rw-r--r-- | src/input_common/motion_input.h | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h index cc35c90ee..b35ad8507 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | namespace Common { | 10 | namespace Common { |
| 11 | 11 | ||
| 12 | constexpr float PI = 3.14159265f; | 12 | constexpr float PI = 3.1415926535f; |
| 13 | 13 | ||
| 14 | template <class T> | 14 | template <class T> |
| 15 | struct Rectangle { | 15 | struct Rectangle { |
diff --git a/src/input_common/motion_input.cpp b/src/input_common/motion_input.cpp index 88fddb1b9..22a849866 100644 --- a/src/input_common/motion_input.cpp +++ b/src/input_common/motion_input.cpp | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included | ||
| 4 | |||
| 5 | #include "common/math_util.h" | ||
| 1 | #include "input_common/motion_input.h" | 6 | #include "input_common/motion_input.h" |
| 2 | 7 | ||
| 3 | namespace InputCommon { | 8 | namespace InputCommon { |
| @@ -69,7 +74,7 @@ void MotionInput::UpdateOrientation(u64 elapsed_time) { | |||
| 69 | } | 74 | } |
| 70 | 75 | ||
| 71 | const auto normal_accel = accel.Normalized(); | 76 | const auto normal_accel = accel.Normalized(); |
| 72 | auto rad_gyro = gyro * 3.1415926535f * 2; | 77 | auto rad_gyro = gyro * Common::PI * 2; |
| 73 | const f32 swap = rad_gyro.x; | 78 | const f32 swap = rad_gyro.x; |
| 74 | rad_gyro.x = rad_gyro.y; | 79 | rad_gyro.x = rad_gyro.y; |
| 75 | rad_gyro.y = -swap; | 80 | rad_gyro.y = -swap; |
diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h index 445798a54..54b4439d9 100644 --- a/src/input_common/motion_input.h +++ b/src/input_common/motion_input.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | // Copyright 2014 Dolphin Emulator Project | 1 | // Copyright 2020 yuzu Emulator Project |
| 2 | // Licensed under GPLv2+ | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included |
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||