From bd7ba0b664fa98381db9ef8edb69ba211213d595 Mon Sep 17 00:00:00 2001 From: Ferenc Arn Date: Tue, 18 Oct 2016 15:50:21 -0500 Subject: Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender). Furthermore, functions which expect a rotation matrix will now give an error simply, rather than trying to orthonormalize such matrices. The documentation for such functions has be updated accordingly. This commit breaks code using 3D rotations, and is a part of the breaking changes in 2.1 -> 3.0 transition. The code affected within Godot code base is fixed in this commit. --- tools/collada/collada.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/collada/collada.cpp') diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp index c62affe5a..204de4508 100644 --- a/tools/collada/collada.cpp +++ b/tools/collada/collada.cpp @@ -144,7 +144,7 @@ Transform Collada::Node::compute_transform(Collada &state) const { case XForm::OP_ROTATE: { if (xf.data.size()>=4) { - xform_step.rotate(Vector3(xf.data[0],xf.data[1],xf.data[2]),-Math::deg2rad(xf.data[3])); + xform_step.rotate(Vector3(xf.data[0],xf.data[1],xf.data[2]),Math::deg2rad(xf.data[3])); } } break; case XForm::OP_SCALE: { @@ -1604,7 +1604,7 @@ Collada::Node* Collada::_parse_visual_instance_camera(XMLParser& parser) { cam->camera= _uri_to_id(parser.get_attribute_value_safe("url")); if (state.up_axis==Vector3::AXIS_Z) //collada weirdness - cam->post_transform.basis.rotate(Vector3(1,0,0),Math_PI*0.5); + cam->post_transform.basis.rotate(Vector3(1,0,0),-Math_PI*0.5); if (parser.is_empty()) //nothing else to parse... return cam; @@ -1625,7 +1625,7 @@ Collada::Node* Collada::_parse_visual_instance_light(XMLParser& parser) { cam->light= _uri_to_id(parser.get_attribute_value_safe("url")); if (state.up_axis==Vector3::AXIS_Z) //collada weirdness - cam->post_transform.basis.rotate(Vector3(1,0,0),Math_PI*0.5); + cam->post_transform.basis.rotate(Vector3(1,0,0),-Math_PI*0.5); if (parser.is_empty()) //nothing else to parse... return cam; -- cgit v1.2.3-70-g09d2