feat: add clearMorphAnimationData function

This commit is contained in:
Nick Fisher
2024-07-23 09:37:08 +08:00
parent d745712650
commit 41bf9ededa
12 changed files with 105 additions and 15 deletions

View File

@@ -781,6 +781,27 @@ namespace thermion_filament
return true;
}
void SceneManager::clearMorphAnimationBuffer(
EntityId entityId)
{
std::lock_guard lock(_mutex);
auto entity = Entity::import(entityId);
if (entity.isNull())
{
Log("ERROR: invalid entity %d.", entityId);
return;
}
auto animationComponentInstance = _animationComponentManager->getInstance(entity);
auto &animationComponent = _animationComponentManager->elementAt<0>(animationComponentInstance);
auto &morphAnimations = animationComponent.morphAnimations;
morphAnimations.clear();
return;
}
bool SceneManager::setMaterialColor(EntityId entityId, const char *meshName, int materialIndex, const float r, const float g, const float b, const float a)
{