Animation blending improved and Animation Override added

This commit is contained in:
viktorljung
2016-02-18 16:34:18 +01:00
parent debb1881bf
commit 3c9c95cff4
9 changed files with 279 additions and 200 deletions
+8 -2
View File
@@ -54,13 +54,19 @@ void AnimationSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& a
e.Entity = entity;
e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)];
m_EventBroker->Publish(e);
nextTime -= animation->Duration;
while(nextTime > animation->Duration) {
nextTime -= animation->Duration;
}
} else if (nextTime < 0) {
Events::AnimationComplete e;
e.Entity = entity;
e.Name = (std::string)animationComponent["AnimationName" + std::to_string(i)];
m_EventBroker->Publish(e);
nextTime += animation->Duration;
while (nextTime < 0) {
nextTime += animation->Duration;
}
}
}