diff --git a/core/math/basis.cpp b/core/math/basis.cpp index d37e7cd51..9da200b40 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -404,7 +404,7 @@ Quaternion Basis::get_rotation_quaternion() const { return m.get_quaternion(); } -void Basis::rotate_to_align(Vector3 p_start_direction, Vector3 p_end_direction) { +void Basis::rotate_to_align(const Vector3 &p_start_direction, const Vector3 &p_end_direction) { // Takes two vectors and rotates the basis from the first vector to the second vector. // Adopted from: https://gist.github.com/kevinmoran/b45980723e53edeb8a5a43c49f134724 const Vector3 axis = p_start_direction.cross(p_end_direction).normalized(); diff --git a/core/math/basis.h b/core/math/basis.h index 4a8d6a923..5ec606e63 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -81,7 +81,7 @@ struct _NO_DISCARD_CLASS_ Basis { Quaternion get_rotation_quaternion() const; Vector3 get_rotation() const { return get_rotation_euler(); }; - void rotate_to_align(Vector3 p_start_direction, Vector3 p_end_direction); + void rotate_to_align(const Vector3 &p_start_direction, const Vector3 &p_end_direction); Vector3 rotref_posscale_decomposition(Basis &rotref) const;