WIP root bone transform calc

This commit is contained in:
Martin Felis
2021-12-03 11:13:08 +01:00
parent d4f9459060
commit 6aabe98931
2 changed files with 168 additions and 3 deletions
+12
View File
@@ -43,6 +43,14 @@ void AnimSamplerNode::Evaluate(
if (!sampling_job.Run()) {
ozz::log::Err() << "Error sampling animation." << std::endl;
}
ozz::vector<ozz::math::SoaTransform> root_bone_cur;
root_bone_prev.push_back(ozz::math::SoaTransform());
sampling_job.ratio = m_anim_ratio;
sampling_job.output = make_span (root_bone_cur);
if (!sampling_job.Run()) {
ozz::log::Err() << "Error sampling animation." << std::endl;
}
ozz::math::SoaFloat3 translation =
root_bone_prev[m_root_bone_index].translation;
@@ -61,6 +69,10 @@ void AnimSamplerNode::Evaluate(
_mm_store_ps(root_current_trans_x, translation.x);
_mm_store_ps(root_current_trans_y, translation.y);
_mm_store_ps(root_current_trans_z, translation.z);
root_transform->translation.x = root_current_trans_x[0];
root_transform->translation.y = root_current_trans_y[0];
root_transform->translation.z = root_current_trans_z[0];
}
void AnimSamplerNode::DrawDebugUi() {