Animation is working segfault on unload

This commit is contained in:
Clément Le Bihan
2021-06-02 15:58:37 +02:00
parent 45a566f197
commit f245fe727b
7 changed files with 48 additions and 14 deletions
@@ -2,6 +2,7 @@
// Created by cbihan on 01/06/2021.
//
#include <iostream>
#include "AnimationsSystem.hpp"
#include "Component/Animation/AnimationsComponent.hpp"
#include "Model/Model.hpp"
@@ -11,12 +12,14 @@ namespace BBM
{
AnimationsSystem::AnimationsSystem()
: WAL::System({typeid(AnimationsComponent),
typeid(Drawable3DComponent<RAY::Drawables::Drawables3D::Model>)})
: WAL::System({
typeid(Drawable3DComponent<RAY::Drawables::Drawables3D::Model>),
typeid(AnimationsComponent)
})
{
}
void AnimationsSystem::onFixedUpdate(WAL::Entity &entity)
void AnimationsSystem::onUpdate(WAL::Entity &entity, std::chrono::nanoseconds)
{
auto &model = entity.getComponent<Drawable3DComponent<RAY::Drawables::Drawables3D::Model>>();
auto &anim = entity.getComponent<AnimationsComponent>();