You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Improve Basis::get_quaternion error message
The previous error message incorrectly suggested that any Basis could be fixed by calling get_rotation_quation() or orthonormalize(). This PR points out that only a valid rotation Basis can be fixed in this way.
This commit is contained in:
@@ -763,7 +763,7 @@ Basis::operator String() const {
|
|||||||
|
|
||||||
Quaternion Basis::get_quaternion() const {
|
Quaternion Basis::get_quaternion() const {
|
||||||
#ifdef MATH_CHECKS
|
#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
|
#endif
|
||||||
/* Allow getting a quaternion from an unnormalized transform */
|
/* Allow getting a quaternion from an unnormalized transform */
|
||||||
Basis m = *this;
|
Basis m = *this;
|
||||||
|
|||||||
Reference in New Issue
Block a user