Fixed issues with unit conversion and animation channels.
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Sat, 25 Jun 2011 07:23:23 +0000 (07:23 +0000)
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Sat, 25 Jun 2011 07:23:23 +0000 (07:23 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/TransformReader.cpp
source/blender/collada/TransformWriter.cpp

index f0491af3a493569d90945327fd7fddf6a6d6d311..ade1475c871a128e01e539a082e17ebb6008f766 100644 (file)
@@ -132,7 +132,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
                boneName = strtok(NULL,"\"");
                
                if( boneName != NULL )
-                       return id_name(ob) + "_" + std::string(boneName);
+                       return /*id_name(ob) + "_" +*/ std::string(boneName);
                else            
                        return id_name(ob);
        }
index 3d624520e53cc9215bc1489d9d7ff2d9e2f1a591..625a0220830c9ff62f510fcf0334a47f022b8b7d 100644 (file)
@@ -45,24 +45,24 @@ void TransformReader::get_node_mat(float mat[][4], COLLADAFW::Node *node, std::m
                COLLADAFW::Transformation *tm = node->getTransformations()[i];
                COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
 
-               switch(type) {
-               case COLLADAFW::Transformation::TRANSLATE:
-                       dae_translate_to_mat4(tm, cur);
-                       break;
-               case COLLADAFW::Transformation::ROTATE:
-                       dae_rotate_to_mat4(tm, cur);
-                       break;
-               case COLLADAFW::Transformation::SCALE:
-                       dae_scale_to_mat4(tm, cur);
-                       break;
-               case COLLADAFW::Transformation::MATRIX:
-                       dae_matrix_to_mat4(tm, cur);
-                       break;
-               case COLLADAFW::Transformation::LOOKAT:
-               case COLLADAFW::Transformation::SKEW:
-                       fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n");
-                       break;
-               }
+                       switch(type) {
+                       case COLLADAFW::Transformation::TRANSLATE:
+                               dae_translate_to_mat4(tm, cur);
+                               break;
+                       case COLLADAFW::Transformation::ROTATE:
+                               dae_rotate_to_mat4(tm, cur);
+                               break;
+                       case COLLADAFW::Transformation::SCALE:
+                               dae_scale_to_mat4(tm, cur);
+                               break;
+                       case COLLADAFW::Transformation::MATRIX:
+                               dae_matrix_to_mat4(tm, cur);
+                               break;
+                       case COLLADAFW::Transformation::LOOKAT:
+                       case COLLADAFW::Transformation::SKEW:
+                               fprintf(stderr, "LOOKAT and SKEW transformations are not supported yet.\n");
+                               break;
+                       }
 
                copy_m4_m4(copy, mat);
                mul_m4_m4m4(mat, cur, copy);
index 8638e16e1c26bb51fbc870b83da530387c8f1a8b..546ca3e30192fab64652cd3290d7d991e8a54ab5 100644 (file)
@@ -98,8 +98,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]);
 }