diff --git a/Assets/Models/MD_RigTest01_SkinningTest.shmodel b/Assets/Models/MD_RigTest01_SkinningTest.shmodel index 342b68d4..bba31203 100644 Binary files a/Assets/Models/MD_RigTest01_SkinningTest.shmodel and b/Assets/Models/MD_RigTest01_SkinningTest.shmodel differ diff --git a/Assets/Scenes/anim.shade b/Assets/Scenes/anim.shade index c39a9f0b..7d993e8f 100644 --- a/Assets/Scenes/anim.shade +++ b/Assets/Scenes/anim.shade @@ -23,11 +23,11 @@ Scale: {x: 1, y: 1, z: 1} IsActive: true Renderable Component: - Mesh: 149723808 + Mesh: 141097368 Material: 128805346 IsActive: true Animator Component: - Rig: 80728853 - Clip: 80728853 + Rig: 72178939 + Clip: 72178939 IsActive: true Scripts: ~ \ No newline at end of file diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index 3ebcc904..ef30ce42 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -181,9 +181,7 @@ namespace Sandbox // Link up SHDebugDraw SHDebugDraw::Init(SHSystemManager::GetSystem()); - auto clip = SHResourceManager::LoadOrGet(77816045); - auto rig = SHResourceManager::LoadOrGet(77816045); - int i = 0; + //auto clip = SHResourceManager::LoadOrGet(141097368); } void SBApplication::Update(void) diff --git a/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp b/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp index 0b4e9795..355ca787 100644 --- a/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp +++ b/SHADE_Engine/src/Animation/SHAnimatorComponent.cpp @@ -133,18 +133,18 @@ namespace SHADE { // Check if there is a channel for this node SHMatrix transformMatrix = node->TransformMatrix; - //const int BONE_IDX = rig->GetNodeIndex(node); - //const auto& CHANNELS = currClip->GetChannels(); - //if (BONE_IDX < CHANNELS.size()) - //{ - // const auto& CHANNEL = CHANNELS[BONE_IDX]; - // transformMatrix = SHMatrix::Transform - // ( - // getInterpolatedValue(CHANNEL.PositionKeyFrames, closestFrameIndex, poseTime), - // getInterpolatedValue(CHANNEL.RotationKeyFrames, closestFrameIndex, poseTime), - // getInterpolatedValue(CHANNEL.ScaleKeyFrames, closestFrameIndex, poseTime) - // ); - //} + const int BONE_IDX = rig->GetNodeIndex(node); + const auto& CHANNELS = currClip->GetChannels(); + if (BONE_IDX < CHANNELS.size()) + { + const auto& CHANNEL = CHANNELS[BONE_IDX]; + transformMatrix = SHMatrix::Transform + ( + getInterpolatedValue(CHANNEL.PositionKeyFrames, closestFrameIndex, poseTime), + getInterpolatedValue(CHANNEL.RotationKeyFrames, closestFrameIndex, poseTime), + getInterpolatedValue(CHANNEL.ScaleKeyFrames, closestFrameIndex, poseTime) + ); + } // Apply parent's transformation transformMatrix = transformMatrix * parentMatrix;