Working skeletal animations!!!

This commit is contained in:
2015-10-15 12:46:23 +02:00
parent 1e3536e060
commit a35d72cac3
16 changed files with 1235 additions and 22 deletions
+20
View File
@@ -0,0 +1,20 @@
#include "PrecompiledHeader.h"
#include "Rendering/AnimationSystem.h"
void dd::Systems::AnimationSystem::RegisterComponents(ComponentFactory* cf)
{
cf->Register<Components::Animation>();
}
void dd::Systems::AnimationSystem::Update(double dt)
{
auto animations = m_World->GetComponentsOfType<Components::Animation>();
if (animations == nullptr) {
return;
}
for (auto& component : *animations) {
auto animation = static_cast<Components::Animation*>(component.get());
animation->Time += animation->Speed * dt;
}
}