virtualx-engine/core/math
Ferenc Arn 6b1252cdfa Fix the order in which additional transformations are applied in Matrix3 and Transform.
This is a part of the breaking changes proposed in PR #6865, solving the issue regarding the order of affine transformations described in #2565. This PR also fixes the affected code within Godot codebase. Includes improvements to documentation too.

Another change is, Matrix3::get_scale() will now return negative scaling when the determinant of the matrix is negative. The rationale behind this is simple: when performing a polar decomposition on a basis matrix M = R.S, we have to ensure that the determinant of R is +1, such that it is a proper rotation matrix (with no reflections) which can be represented by Euler angles or a quaternion.

Also replaced the few instances of float with real_t in Matrix3 and Transform.

Furthermore, this PR fixes an issue introduced due to the API breakage in #6865. Namely Matrix3::get_euler() now only works with proper rotation matrices. As a result, the code that wants to get the rotation portion of a transform needs to use Matrix3::get_rotation() introduced in this commit, which complements Matrix3::get_scaled(), providing both parts of the polar decomposition.

Finally, it is now possible to construct a rotation matrix from Euler angles using the new constructor Matrix3::Matrix3(const Vector3 &p_euler).
2017-01-08 10:36:14 -06:00
..
a_star.cpp ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
a_star.h ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
aabb.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
aabb.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
bsp_tree.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
bsp_tree.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
camera_matrix.cpp Merge remote-tracking branch 'origin/gles3' into gles3-on-master 2017-01-02 21:52:26 +01:00
camera_matrix.h Merge remote-tracking branch 'origin/gles3' into gles3-on-master 2017-01-02 21:52:26 +01:00
face3.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
face3.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
geometry.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
geometry.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_2d.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_2d.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_defs.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_funcs.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
math_funcs.h Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender). 2017-01-03 17:41:04 -06:00
matrix3.cpp Fix the order in which additional transformations are applied in Matrix3 and Transform. 2017-01-08 10:36:14 -06:00
matrix3.h Fix the order in which additional transformations are applied in Matrix3 and Transform. 2017-01-08 10:36:14 -06:00
octree.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
plane.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
plane.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
quat.cpp Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender). 2017-01-03 17:41:04 -06:00
quat.h Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender). 2017-01-03 17:41:04 -06:00
quick_hull.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
quick_hull.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
SCsub style: Fix PEP8 whitespace issues in Python files 2016-11-01 00:35:16 +01:00
transform.cpp Fix the order in which additional transformations are applied in Matrix3 and Transform. 2017-01-08 10:36:14 -06:00
transform.h Fix the order in which additional transformations are applied in Matrix3 and Transform. 2017-01-08 10:36:14 -06:00
triangle_mesh.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
triangle_mesh.h ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant. 2017-01-02 23:03:46 -03:00
triangulate.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
triangulate.h Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
triangulator.cpp begin new serialization framework 2015-02-15 01:21:26 -03:00
triangulator.h begin new serialization framework 2015-02-15 01:21:26 -03:00
vector3.cpp Welcome in 2017, dear changelog reader! 2017-01-01 22:03:33 +01:00
vector3.h Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender). 2017-01-03 17:41:04 -06:00