forked from bartvdbraak/blender
Fixed issues with unit conversion and animation channels.
This commit is contained in:
parent
6c33d3f00d
commit
c863cdcaf3
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user