Implmented GLTF Compile and Load Overhaul #404

Merged
XiaoQiDigipen merged 17 commits from SP3-13-Assets-Manager into main 2023-03-07 23:27:01 +08:00
4 changed files with 16 additions and 18 deletions
Showing only changes of commit f861304f5e - Show all commits

View File

@ -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: ~

View File

@ -181,9 +181,7 @@ namespace Sandbox
// Link up SHDebugDraw
SHDebugDraw::Init(SHSystemManager::GetSystem<SHDebugDrawSystem>());
auto clip = SHResourceManager::LoadOrGet<SHAnimationClip>(77816045);
auto rig = SHResourceManager::LoadOrGet<SHRig>(77816045);
int i = 0;
//auto clip = SHResourceManager::LoadOrGet<SHMesh>(141097368);
}
void SBApplication::Update(void)

View File

@ -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;