This commit is contained in:
Nick Fisher
2023-09-01 12:56:25 +08:00
11 changed files with 275 additions and 94 deletions

View File

@@ -303,6 +303,9 @@ void AssetManager::updateAnimations() {
break;
}
}
if(anim.mLoop && elapsed >= anim.mDuration) {
anim.mStart = now;
}
// animation has completed
} else {
completed.push_back(anim);
@@ -390,9 +393,16 @@ void AssetManager::setMorphTargetWeights(EntityId entityId, const char* const en
}
RenderableManager &rm = _engine->getRenderableManager();
auto renderableInstance = rm.getInstance(entity);
if(!renderableInstance.isValid()) {
Log("Warning: failed to find renderable instance for entity %s", entityName);
return;
}
rm.setMorphWeights(
rm.getInstance(entity),
renderableInstance,
weights,
count
);