Merge pull request #52229 from lawnjelly/basis_quat_warning

Improve Basis::get_quaternion error message
This commit is contained in:
Max Hilbrunner 2021-09-10 13:21:00 +02:00 committed by GitHub
commit 744d5829b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -775,7 +775,7 @@ Basis::operator String() const {
Quaternion Basis::get_quaternion() const {
#ifdef MATH_CHECKS
ERR_FAIL_COND_V_MSG(!is_rotation(), Quaternion(), "Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quaternion() or call orthonormalized() instead.");
ERR_FAIL_COND_V_MSG(!is_rotation(), Quaternion(), "Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quaternion() or call orthonormalized() if the Basis contains linearly independent vectors.");
#endif
/* Allow getting a quaternion from an unnormalized transform */
Basis m = *this;