diff options
Diffstat (limited to 'source/blender/collada/TransformWriter.cpp')
-rw-r--r-- | source/blender/collada/TransformWriter.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp index 8638e16e1c2..7bad9bdeba7 100644 --- a/source/blender/collada/TransformWriter.cpp +++ b/source/blender/collada/TransformWriter.cpp @@ -48,9 +48,15 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[][4], copy_m4_m4(local, mat); } + double dmat[4][4]; + UnitConverter* converter = new UnitConverter(); + converter->mat4_to_dae_double(dmat,local); + TransformBase::decompose(local, loc, rot, NULL, scale); - - add_transform(node, loc, rot, scale); + if ( node.getType() == COLLADASW::Node::JOINT) + node.addMatrix("transform",dmat); + else + add_transform(node, loc, rot, scale); } void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob) @@ -98,8 +104,12 @@ void TransformWriter::add_node_transform_identity(COLLADASW::Node& node) void TransformWriter::add_transform(COLLADASW::Node& node, float loc[3], float rot[3], float scale[3]) { node.addTranslate("location", loc[0], loc[1], loc[2]); - node.addRotateZ("rotationZ", COLLADABU::Math::Utils::radToDegF(rot[2])); + /*node.addRotateZ("rotationZ", COLLADABU::Math::Utils::radToDegF(rot[2])); node.addRotateY("rotationY", COLLADABU::Math::Utils::radToDegF(rot[1])); - node.addRotateX("rotationX", COLLADABU::Math::Utils::radToDegF(rot[0])); + node.addRotateX("rotationX", COLLADABU::Math::Utils::radToDegF(rot[0]));*/ + node.addRotateZ("rotationZ", rot[2] * 180.0f/M_PI); + node.addRotateY("rotationY", (rot[1]* 180.0f/M_PI)); + node.addRotateX("rotationX", (rot[0]* 180.0f/M_PI)); + node.addScale("scale", scale[0], scale[1], scale[2]); } |