Mark the parameters of Basis::rotate_to_align as const ref.

This commit is contained in:
Relintai 2023-05-29 13:03:26 +02:00
parent 9e326c3000
commit 47e637b2b8
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -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;