WIP animation based root bone transform calculation.
This commit is contained in:
@@ -5,12 +5,15 @@
|
||||
#include "LockTranslationNode.h"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include "ozz/base/maths/soa_transform.h"
|
||||
|
||||
void LockTranslationNode::Evaluate(
|
||||
ozz::vector<ozz::math::SoaTransform>* local_matrices) {
|
||||
m_input->Evaluate(local_matrices);
|
||||
ozz::math::SoaFloat3 translation = (*local_matrices)[m_locked_bone_index].translation;
|
||||
ozz::vector<ozz::math::SoaTransform>* local_matrices,
|
||||
ozz::math::Transform* root_transform) {
|
||||
m_input->Evaluate(local_matrices, root_transform);
|
||||
ozz::math::SoaFloat3 translation =
|
||||
(*local_matrices)[m_locked_bone_index].translation;
|
||||
float x[4];
|
||||
float y[4];
|
||||
float z[4];
|
||||
@@ -35,13 +38,14 @@ void LockTranslationNode::Evaluate(
|
||||
translation.z = _mm_load_ps(z);
|
||||
|
||||
//translation = ozz::math::SoaFloat3::zero();
|
||||
// ozz::math::SetX(translation, 0.f);
|
||||
// ozz::math::SetZ(translation, 0.f);
|
||||
(*local_matrices)[m_locked_bone_index].translation = translation;
|
||||
// ozz::math::SetX(translation, 0.f);
|
||||
// ozz::math::SetZ(translation, 0.f);
|
||||
(*local_matrices)[m_locked_bone_index].translation = translation;
|
||||
}
|
||||
|
||||
void LockTranslationNode::DrawDebugUi() {
|
||||
const ozz::animation::Skeleton& skeleton = m_animation_controller->m_skinned_mesh->m_skeleton;
|
||||
const ozz::animation::Skeleton& skeleton =
|
||||
m_animation_controller->m_skinned_mesh->m_skeleton;
|
||||
ozz::span<const char* const> joint_names = skeleton.joint_names();
|
||||
|
||||
const char* items[255] = {0};
|
||||
@@ -54,6 +58,4 @@ void LockTranslationNode::DrawDebugUi() {
|
||||
ImGui::Checkbox("Lock X", &m_lock_x);
|
||||
ImGui::Checkbox("Lock Y", &m_lock_y);
|
||||
ImGui::Checkbox("Lock Z", &m_lock_z);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user