Fix for importing animated skinned meshes.

Scale is negated in inverse bind matrices.
Vertex weights are normalized (glTF importer is limited to 4 weights per vert).
Fixed interpolation for animations where the first frame is not at 0.0.
Allows cached.dts version of assimp imported shapes to be loaded.
This commit is contained in:
OTHGMars 2019-04-25 16:02:22 -04:00
parent 6be2989bbc
commit 6660f253b5
4 changed files with 35 additions and 14 deletions

View file

@ -19,6 +19,7 @@ AssimpAppSequence::AssimpAppSequence(aiAnimation *a) :
mSequenceName = mAnim->mName.C_Str();
if (mSequenceName.isEmpty())
mSequenceName = "ambient";
Con::printf("\n[Assimp] Adding %s animation", mSequenceName.c_str());
fps = (mAnim->mTicksPerSecond > 0) ? mAnim->mTicksPerSecond : 30.0f;
@ -72,6 +73,7 @@ AssimpAppSequence::AssimpAppSequence(aiAnimation *a) :
minFrameTime /= (F32)timeFactor;
maxEndTime /= (F32)timeFactor;
fps = (minFrameTime > 0.0f) ? 1.0f / minFrameTime : fps;
fps = mClamp(fpsRequest, 5 /*TSShapeLoader::MinFrameRate*/, TSShapeLoader::MaxFrameRate);
seqEnd = maxEndTime;
mTimeMultiplier = 1.0f / timeFactor;
}