Build dependency

This commit is contained in:
hodasemi 2018-05-29 22:28:59 +02:00
parent 52db577e51
commit fd53e8e1e3
3 changed files with 13 additions and 6 deletions

View file

@ -52,7 +52,8 @@
"typeinfo": "cpp",
"utility": "cpp",
"variant": "cpp",
"algorithm": "cpp"
"algorithm": "cpp",
"new": "cpp"
},
"editor.formatOnSave": true
}

3
.vscode/tasks.json vendored
View file

@ -12,7 +12,8 @@
"plugin:cg_fltk.cgv",
"plugin:CGII.cgv",
"plugin:crg_stereo_view.cgv"
]
],
"dependsOn": "Build CGII"
},
{
"label": "Build All",

View file

@ -41,12 +41,17 @@ void Bone::calculate_matrices()
{
orientationTransformGlobalToLocal.identity();
std::for_each(orientation.begin(), orientation.end(), [&](AtomicTransform *t) {
std::cout << "atomic transform " << t->get_name() << ": " << t->get_value() << std::endl;
std::cout << name << " orientation " << t->get_name() << ": " << t->get_value() << std::endl;
orientationTransformGlobalToLocal = orientationTransformGlobalToLocal * t->calculate_matrix();
});
orientationTransformLocalToGlobal = cgv::math::inv(orientationTransformGlobalToLocal);
std::for_each(dofs.begin(), dofs.end(), [&](std::shared_ptr<AtomicTransform> &t) {
//std::cout << "dofs " << t->get_name() << ": " << t->get_value() << std::endl;
});
/*Task 2.1: Implement matrix calculation */
Mat4 matrix;
matrix.identity();
@ -109,17 +114,17 @@ Mat4 Bone::calculate_transform_prev_to_current_with_dofs()
dofs.identity();
std::for_each(orientation.begin(), orientation.end(), [&](AtomicTransform *t) {
dofs = dofs * t->calculate_matrix();
//dofs = dofs * t->calculate_matrix();
});
Mat4 t = translationTransformCurrentJointToNext * orientationTransformPrevJointToCurrent * dofs;
Mat4 t = translationTransformCurrentJointToNext * orientationTransformPrevJointToCurrent * dofs; // * orientationTransformGlobalToLocal;
return t;
}
Mat4 Bone::calculate_transform_prev_to_current_without_dofs()
{
//Task 2.1: Implement matrix calculation
Mat4 t = translationTransformCurrentJointToNext * orientationTransformPrevJointToCurrent;
Mat4 t = translationTransformCurrentJointToNext * orientationTransformPrevJointToCurrent * orientationTransformLocalToGlobal * orientationTransformGlobalToLocal;
return t;
}