diff options
author | Lioncash <mathew1800@gmail.com> | 2019-02-27 04:38:34 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-02-27 04:38:36 +0100 |
commit | 1b855efd5eb21ef802d15f6a531878754904ad4d (patch) | |
tree | ae6fe25b9e889790b1770bbc77d67e4819d5f572 /src/input_common | |
parent | common/quaternion: Move Quaternion into the Common namespace (diff) | |
download | yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.gz yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.bz2 yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.lz yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.xz yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.zst yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/motion_emu.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/input_common/motion_emu.cpp b/src/input_common/motion_emu.cpp index defb1a567..d5af05ee3 100644 --- a/src/input_common/motion_emu.cpp +++ b/src/input_common/motion_emu.cpp @@ -32,12 +32,12 @@ public: } void BeginTilt(int x, int y) { - mouse_origin = Math::MakeVec(x, y); + mouse_origin = Common::MakeVec(x, y); is_tilting = true; } void Tilt(int x, int y) { - auto mouse_move = Math::MakeVec(x, y) - mouse_origin; + auto mouse_move = Common::MakeVec(x, y) - mouse_origin; if (is_tilting) { std::lock_guard<std::mutex> guard(tilt_mutex); if (mouse_move.x == 0 && mouse_move.y == 0) { @@ -56,7 +56,7 @@ public: is_tilting = false; } - std::tuple<Math::Vec3<float>, Math::Vec3<float>> GetStatus() { + std::tuple<Common::Vec3<float>, Common::Vec3<float>> GetStatus() { std::lock_guard<std::mutex> guard(status_mutex); return status; } @@ -66,17 +66,17 @@ private: const std::chrono::steady_clock::duration update_duration; const float sensitivity; - Math::Vec2<int> mouse_origin; + Common::Vec2<int> mouse_origin; std::mutex tilt_mutex; - Math::Vec2<float> tilt_direction; + Common::Vec2<float> tilt_direction; float tilt_angle = 0; bool is_tilting = false; Common::Event shutdown_event; - std::tuple<Math::Vec3<float>, Math::Vec3<float>> status; + std::tuple<Common::Vec3<float>, Common::Vec3<float>> status; std::mutex status_mutex; // Note: always keep the thread declaration at the end so that other objects are initialized @@ -85,7 +85,7 @@ private: void MotionEmuThread() { auto update_time = std::chrono::steady_clock::now(); - Common::Quaternion<float> q = Common::MakeQuaternion(Math::Vec3<float>(), 0); + Common::Quaternion<float> q = Common::MakeQuaternion(Common::Vec3<float>(), 0); Common::Quaternion<float> old_q; while (!shutdown_event.WaitUntil(update_time)) { @@ -96,14 +96,14 @@ private: std::lock_guard<std::mutex> guard(tilt_mutex); // Find the quaternion describing current 3DS tilting - q = Common::MakeQuaternion(Math::MakeVec(-tilt_direction.y, 0.0f, tilt_direction.x), - tilt_angle); + q = Common::MakeQuaternion( + Common::MakeVec(-tilt_direction.y, 0.0f, tilt_direction.x), tilt_angle); } auto inv_q = q.Inverse(); // Set the gravity vector in world space - auto gravity = Math::MakeVec(0.0f, -1.0f, 0.0f); + auto gravity = Common::MakeVec(0.0f, -1.0f, 0.0f); // Find the angular rate vector in world space auto angular_rate = ((q - old_q) * inv_q).xyz * 2; @@ -131,7 +131,7 @@ public: device = std::make_shared<MotionEmuDevice>(update_millisecond, sensitivity); } - std::tuple<Math::Vec3<float>, Math::Vec3<float>> GetStatus() const override { + std::tuple<Common::Vec3<float>, Common::Vec3<float>> GetStatus() const override { return device->GetStatus(); } |