Files
Seele/src/Engine/System/MeshUpdater.cpp
T

33 lines
720 B
C++
Raw Normal View History

2023-10-24 15:01:09 +02:00
#include "MeshUpdater.h"
using namespace Seele;
using namespace Seele::System;
2023-10-26 18:37:29 +02:00
MeshUpdater::MeshUpdater(PScene scene)
2023-11-22 13:18:54 +01:00
: SystemBase(scene)
2023-10-26 18:37:29 +02:00
{
2023-11-22 13:18:54 +01:00
scene->view<Component::Mesh>([&](entt::entity id, Component::Mesh& mesh) {
meshEntities.add(id);
});
scene->constructCallback<Component::Mesh>().connect<&MeshUpdater::on_construct>(this);
scene->destroyCallback<Component::Mesh>().connect<&MeshUpdater::on_destroy>(this);
2023-10-26 18:37:29 +02:00
}
2023-11-01 23:12:30 +01:00
MeshUpdater::~MeshUpdater()
{
}
2023-11-22 13:18:54 +01:00
void MeshUpdater::update()
2023-10-24 15:01:09 +02:00
{
2023-11-22 13:18:54 +01:00
}
void MeshUpdater::on_construct(entt::registry& reg, entt::entity id)
{
meshEntities.add(id);
}
void MeshUpdater::on_destroy(entt::registry& reg, entt::entity id)
{
meshEntities.remove(id, false);
2023-10-24 15:01:09 +02:00
}