diff options
| author | 2020-11-16 21:40:16 -0800 | |
|---|---|---|
| committer | 2020-11-16 21:40:16 -0800 | |
| commit | 8ace3959a57a54bedea290e0b1370ae965f74a7d (patch) | |
| tree | ce02144d20896c3ae0ffe75643714467b5901e50 /src | |
| parent | Merge pull request #4914 from lat9nq/gl-warnings (diff) | |
| parent | motion_input: Mark constructor as explicit (diff) | |
| download | yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.gz yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.tar.xz yuzu-8ace3959a57a54bedea290e0b1370ae965f74a7d.zip | |
Merge pull request #4929 from lioncash/nodiscard-input
motion_input: Mark member functions as [[nodiscard]] where applicable
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/motion_input.h | 23 |
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 { | |||
| 13 | 13 | ||
| 14 | class MotionInput { | 14 | class MotionInput { |
| 15 | public: | 15 | public: |
| 16 | MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); | 16 | explicit MotionInput(f32 new_kp, f32 new_ki, f32 new_kd); |
| 17 | 17 | ||
| 18 | MotionInput(const MotionInput&) = default; | 18 | MotionInput(const MotionInput&) = default; |
| 19 | MotionInput& operator=(const MotionInput&) = default; | 19 | MotionInput& operator=(const MotionInput&) = default; |
| @@ -33,16 +33,17 @@ public: | |||
| 33 | void UpdateRotation(u64 elapsed_time); | 33 | void UpdateRotation(u64 elapsed_time); |
| 34 | void UpdateOrientation(u64 elapsed_time); | 34 | void UpdateOrientation(u64 elapsed_time); |
| 35 | 35 | ||
| 36 | std::array<Common::Vec3f, 3> GetOrientation() const; | 36 | [[nodiscard]] std::array<Common::Vec3f, 3> GetOrientation() const; |
| 37 | Common::Vec3f GetAcceleration() const; | 37 | [[nodiscard]] Common::Vec3f GetAcceleration() const; |
| 38 | Common::Vec3f GetGyroscope() const; | 38 | [[nodiscard]] Common::Vec3f GetGyroscope() const; |
| 39 | Common::Vec3f GetRotations() const; | 39 | [[nodiscard]] Common::Vec3f GetRotations() const; |
| 40 | Common::Quaternion<f32> GetQuaternion() const; | 40 | [[nodiscard]] Common::Quaternion<f32> GetQuaternion() const; |
| 41 | Input::MotionStatus GetMotion() const; | 41 | [[nodiscard]] Input::MotionStatus GetMotion() const; |
| 42 | Input::MotionStatus GetRandomMotion(int accel_magnitude, int gyro_magnitude) const; | 42 | [[nodiscard]] Input::MotionStatus GetRandomMotion(int accel_magnitude, |
| 43 | 43 | int gyro_magnitude) const; | |
| 44 | bool IsMoving(f32 sensitivity) const; | 44 | |
| 45 | bool IsCalibrated(f32 sensitivity) const; | 45 | [[nodiscard]] bool IsMoving(f32 sensitivity) const; |
| 46 | [[nodiscard]] bool IsCalibrated(f32 sensitivity) const; | ||
| 46 | 47 | ||
| 47 | private: | 48 | private: |
| 48 | void ResetOrientation(); | 49 | void ResetOrientation(); |