1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

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.
This commit is contained in:
Ferenc Arn
2017-03-23 12:27:00 -05:00
parent c37fad650f
commit 6bb9b58b09
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);