summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-17 06:40:16 +0100
committerGitHub <noreply@github.com>2020-11-17 06:40:16 +0100
commit8ace3959a57a54bedea290e0b1370ae965f74a7d (patch)
treece02144d20896c3ae0ffe75643714467b5901e50
parentMerge pull request #4914 from lat9nq/gl-warnings (diff)
parentmotion_input: Mark constructor as explicit (diff)
downloadyuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.gz
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.bz2
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.lz
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.xz
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.zst
yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.zip
-rw-r--r--src/input_common/motion_input.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/input_common/motion_input.h b/src/input_common/motion_input.h
index abb957f04..efe74cf19 100644
--- a/src/input_common/motion_input.h
+++ b/src/input_common/motion_input.h
@@ -13,7 +13,7 @@ namespace InputCommon {
class MotionInput {
public:
- MotionInput(f32 new_kp, f32 new_ki, f32 new_kd);
+ explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd);
MotionInput(const MotionInput&) = default;
MotionInput& operator=(const MotionInput&) = default;
@@ -33,16 +33,17 @@ public:
void UpdateRotation(u64 elapsed_time);
void UpdateOrientation(u64 elapsed_time);
- std::array<Common::Vec3f, 3> GetOrientation() const;
- Common::Vec3f GetAcceleration() const;
- Common::Vec3f GetGyroscope() const;
- Common::Vec3f GetRotations() const;
- Common::Quaternion<f32> GetQuaternion() const;
- Input::MotionStatus GetMotion() const;
- Input::MotionStatus GetRandomMotion(int accel_magnitude, int gyro_magnitude) const;
-
- bool IsMoving(f32 sensitivity) const;
- bool IsCalibrated(f32 sensitivity) const;
+ [[nodiscard]] std::array<Common::Vec3f, 3> GetOrientation() const;
+ [[nodiscard]] Common::Vec3f GetAcceleration() const;
+ [[nodiscard]] Common::Vec3f GetGyroscope() const;
+ [[nodiscard]] Common::Vec3f GetRotations() const;
+ [[nodiscard]] Common::Quaternion<f32> 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();