From 6d108f0dcb5b388c3586f90426fc2c832a8bffc0 Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 20 Sep 2021 17:39:58 -0500 Subject: input_common: Remove obsolete files --- src/input_common/motion_input.h | 74 ----------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/input_common/motion_input.h (limited to 'src/input_common/motion_input.h') diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h deleted file mode 100644 index efe74cf19..000000000 --- a/src/input_common/motion_input.h +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020 yuzu Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included - -#pragma once - -#include "common/common_types.h" -#include "common/quaternion.h" -#include "common/vector_math.h" -#include "core/frontend/input.h" - -namespace InputCommon { - -class MotionInput { -public: - explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); - - MotionInput(const MotionInput&) = default; - MotionInput& operator=(const MotionInput&) = default; - - MotionInput(MotionInput&&) = default; - MotionInput& operator=(MotionInput&&) = default; - - void SetAcceleration(const Common::Vec3f& acceleration); - void SetGyroscope(const Common::Vec3f& gyroscope); - void SetQuaternion(const Common::Quaternion& quaternion); - void SetGyroDrift(const Common::Vec3f& drift); - void SetGyroThreshold(f32 threshold); - - void EnableReset(bool reset); - void ResetRotations(); - - void UpdateRotation(u64 elapsed_time); - void UpdateOrientation(u64 elapsed_time); - - [[nodiscard]] std::array GetOrientation() const; - [[nodiscard]] Common::Vec3f GetAcceleration() const; - [[nodiscard]] Common::Vec3f GetGyroscope() const; - [[nodiscard]] Common::Vec3f GetRotations() const; - [[nodiscard]] Common::Quaternion GetQuaternion() const; - [[nodiscard]] Input::MotionStatus GetMotion() const; - [[nodiscard]] Input::MotionStatus GetRandomMotion(int accel_magnitude, - int gyro_magnitude) const; - - [[nodiscard]] bool IsMoving(f32 sensitivity) const; - [[nodiscard]] bool IsCalibrated(f32 sensitivity) const; - -private: - void ResetOrientation(); - void SetOrientationFromAccelerometer(); - - // PID constants - f32 kp; - f32 ki; - f32 kd; - - // PID errors - Common::Vec3f real_error; - Common::Vec3f integral_error; - Common::Vec3f derivative_error; - - Common::Quaternion quat{{0.0f, 0.0f, -1.0f}, 0.0f}; - Common::Vec3f rotations; - Common::Vec3f accel; - Common::Vec3f gyro; - Common::Vec3f gyro_drift; - - f32 gyro_threshold = 0.0f; - u32 reset_counter = 0; - bool reset_enabled = true; - bool only_accelerometer = true; -}; - -} // namespace InputCommon -- cgit v1.2.3