Просмотр исходного кода

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.
Morph 5 лет назад
Родитель
Сommit
45ecd601be
3 измененных файлов с 10 добавлено и 5 удалено
  1. 1 1
      src/common/math_util.h
  2. 6 1
      src/input_common/motion_input.cpp
  3. 3 3
      src/input_common/motion_input.h

+ 1 - 1
src/common/math_util.h

@@ -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 {

+ 6 - 1
src/input_common/motion_input.cpp

@@ -1,3 +1,8 @@
+// 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) {
     }
     }
 
 
     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;

+ 3 - 3
src/input_common/motion_input.h

@@ -1,6 +1,6 @@
-// Copyright 2014 Dolphin Emulator Project
-// Licensed under GPLv2+
-// Refer to the license.txt file included.
+// Copyright 2020 yuzu Emulator Project
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included
 
 
 #pragma once
 #pragma once