From 6bb9b58b09aee7fc543c03844ce51b62c838dadd Mon Sep 17 00:00:00 2001 From: Ferenc Arn Date: Thu, 23 Mar 2017 12:27:00 -0500 Subject: Explicitly documented that Transform.basis is not necessarily an orthogonal matrix. Also added a check that in axis-angle rotations, axis is a normalized vector, and modified the docs accordingly. Fixes #8113. --- core/math/matrix3.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/math/matrix3.cpp') diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 5f73d91ef..f154552a3 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -575,6 +575,8 @@ Basis::Basis(const Quat &p_quat) { Basis::Basis(const Vector3 &p_axis, real_t p_phi) { // Rotation matrix from axis and angle, see https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle + ERR_FAIL_COND(p_axis.is_normalized() == false); + Vector3 axis_sq(p_axis.x * p_axis.x, p_axis.y * p_axis.y, p_axis.z * p_axis.z); real_t cosine = Math::cos(p_phi); -- cgit v1.2.3-70-g09d2