diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 8fb42fa5e..875453ce4 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -239,6 +239,13 @@ Basis Basis::create_from_scale(const Vector3 &p_scale) { return Basis(p_scale.x, 0, 0, 0, p_scale.y, 0, 0, 0, p_scale.z); } +Basis Basis::looking_at(const Vector3 &p_target, const Vector3 &p_up) { + return Basis::create_looking_at(p_target, p_up); +} +Basis Basis::from_scale(const Vector3 &p_scale) { + return Basis::create_from_scale(p_scale); +} + // Multiplies the matrix from left by the scaling matrix: M -> S.M // See the comment for Basis::rotated for further explanation. void Basis::scale(const Vector3 &p_scale) { diff --git a/core/math/basis.h b/core/math/basis.h index beb583f8e..bdf22ad34 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -289,6 +289,9 @@ struct _NO_DISCARD_CLASS_ Basis { static Basis create_looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); static Basis create_from_scale(const Vector3 &p_scale); + Basis looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0)); + Basis from_scale(const Vector3 &p_scale); + operator Quaternion() const { return get_quaternion(); } Basis(const Quaternion &p_quat) { set_quaternion(p_quat); }