Fix endeffector location when parent is transformed

This commit is contained in:
hodasemi 2018-06-17 23:06:27 +02:00
parent 697268cd0b
commit a203ad7057

View file

@ -170,6 +170,9 @@ void IKViewer::calculate_kinematic_chain(Bone *base, Bone *endeffector)
Bone *bone = base_tree[base_index];
std::shared_ptr<Transform> inverse_static = std::shared_ptr<Transform>(new StaticTransform(inv(bone->calculate_transform_prev_to_current_without_dofs())));
kinematic_chain.emplace_front(inverse_static);
//for (int i = bone->dof_count() - 1; i >= 0; i--)
for (int i = 0; i < bone->dof_count(); i++)
{
@ -178,9 +181,6 @@ void IKViewer::calculate_kinematic_chain(Bone *base, Bone *endeffector)
kinematic_chain.emplace_front(inverse_dof);
}
std::shared_ptr<Transform> inverse_static = std::shared_ptr<Transform>(new StaticTransform(inv(bone->calculate_transform_prev_to_current_without_dofs())));
kinematic_chain.emplace_front(inverse_static);
base_index--;
}
else