Merge pull request #8122 from tagcup/axis_check_normalization

Explicitly documented that Transform.basis is not necessarily an orth…
This commit is contained in:
Rémi Verschelde
2017-03-24 22:51:27 +01:00
committed by GitHub
3 changed files with 13 additions and 6 deletions

View File

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