diff options
author | Ricard Rovira Cubeles <ricardrocu@gmail.com> | 2021-08-15 16:45:37 +0200 |
---|---|---|
committer | Ricard Rovira Cubeles <ricardrocu@gmail.com> | 2021-08-15 16:45:37 +0200 |
commit | a8d12b5a613400024eaeea37266cf7cf4bca3724 (patch) | |
tree | dec459af0480557c9e06ba212833fbcac8e64b52 /modules | |
parent | 966559c3bdcdc7eeb0cd04098520250580ea3a04 (diff) |
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.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mobile_vr/mobile_vr_interface.h | 8 |
1 files changed, 4 insertions, 4 deletions
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); }; |