IQM Refactor start

- Refactored IQM and calculateBones to process TRS at runtime which resolves some of the faulty animations with large rotations. Will also make bone manipulations much easier to do
This commit is contained in:
Shiny Metagross 2022-10-26 11:30:59 -07:00 committed by Christoph Oelckers
commit 3f3cc5bbc3
7 changed files with 140 additions and 96 deletions

View file

@ -352,7 +352,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
auto& ssids = surfaceskinids.Size() > 0 ? surfaceskinids : smf->surfaceskinIDs;
auto ssidp = (unsigned)(i * MD3_MAX_SURFACES) < ssids.Size() ? &ssids[i * MD3_MAX_SURFACES] : nullptr;
const TArray<VSMatrix>* animationData = nullptr;
const TArray<TRS>* animationData = nullptr;
bool nextFrame = smfNext && modelframe != modelframenext;
@ -363,7 +363,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
{
boneData = animation->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
boneData = animation->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData, actor);
boneStartingPosition = renderer->SetupFrame(animation, 0, 0, 0, boneData, -1);
evaluatedSingle = true;
}
@ -372,7 +372,7 @@ void RenderFrameModels(FModelRenderer *renderer, FLevelLocals *Level, const FSpr
{
if (!(smf->flags & MDL_MODELSAREATTACHMENTS) || evaluatedSingle == false)
{
boneData = mdl->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData);
boneData = mdl->CalculateBones(modelframe, nextFrame ? modelframenext : modelframe, nextFrame ? inter : 0.f, *animationData, actor);
boneStartingPosition = renderer->SetupFrame(mdl, 0, 0, 0, boneData, -1);
evaluatedSingle = true;
}