From a8d12b5a613400024eaeea37266cf7cf4bca3724 Mon Sep 17 00:00:00 2001 From: Ricard Rovira Cubeles Date: Sun, 15 Aug 2021 16:45:37 +0200 Subject: Add constant to vector function parameters that don't actually modify their input. Add more overloads of vector multiplication, required by templates to compile with float=64. --- modules/mobile_vr/mobile_vr_interface.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/mobile_vr/mobile_vr_interface.h b/modules/mobile_vr/mobile_vr_interface.h index 29ce0f92c8..0c05dc1ebb 100644 --- a/modules/mobile_vr/mobile_vr_interface.h +++ b/modules/mobile_vr/mobile_vr_interface.h @@ -86,20 +86,20 @@ private: Vector3 mag_next_max; ///@TODO a few support functions for trackers, most are math related and should likely be moved elsewhere - float floor_decimals(float p_value, float p_decimals) { + float floor_decimals(const float p_value, const float p_decimals) { float power_of_10 = pow(10.0f, p_decimals); return floor(p_value * power_of_10) / power_of_10; }; - Vector3 floor_decimals(const Vector3 &p_vector, float p_decimals) { + Vector3 floor_decimals(const Vector3 &p_vector, const float p_decimals) { return Vector3(floor_decimals(p_vector.x, p_decimals), floor_decimals(p_vector.y, p_decimals), floor_decimals(p_vector.z, p_decimals)); }; - Vector3 low_pass(const Vector3 &p_vector, const Vector3 &p_last_vector, float p_factor) { + Vector3 low_pass(const Vector3 &p_vector, const Vector3 &p_last_vector, const float p_factor) { return p_vector + (p_factor * (p_last_vector - p_vector)); }; - Vector3 scrub(const Vector3 &p_vector, const Vector3 &p_last_vector, float p_decimals, float p_factor) { + Vector3 scrub(const Vector3 &p_vector, const Vector3 &p_last_vector, const float p_decimals, const float p_factor) { return low_pass(floor_decimals(p_vector, p_decimals), p_last_vector, p_factor); }; -- cgit v1.2.3