1#include <Engine/Scene/GeometrySystem.hpp>
3#include <Core/Asset/FileData.hpp>
4#include <Core/Asset/GeometryData.hpp>
5#include <Core/Tasks/Task.hpp>
6#include <Core/Tasks/TaskQueue.hpp>
8#include <Engine/RadiumEngine.hpp>
9#include <Engine/Scene/ComponentMessenger.hpp>
10#include <Engine/Scene/Entity.hpp>
11#include <Engine/Scene/GeometryComponent.hpp>
17GeometrySystem::GeometrySystem() : System() {}
19void GeometrySystem::handleAssetLoading( Entity* entity,
20 const Ra::Core::Asset::FileData* fileData ) {
21 auto geomData = fileData->getGeometryData();
25 for (
const auto& data : geomData ) {
26 Component* comp {
nullptr };
28 switch ( data->getType() ) {
29 case Ra::Core::Asset::GeometryData::POINT_CLOUD:
30 comp =
new PointCloudComponent( componentName, entity, data );
32 case Ra::Core::Asset::GeometryData::LINE_MESH:
35 case Ra::Core::Asset::GeometryData::TRI_MESH:
36 comp =
new TriangleMeshComponent( componentName, entity, data );
38 case Ra::Core::Asset::GeometryData::QUAD_MESH:
39 comp =
new QuadMeshComponent( componentName, entity, data );
41 case Ra::Core::Asset::GeometryData::POLY_MESH:
42 comp =
new PolyMeshComponent( componentName, entity, data );
44 case Ra::Core::Asset::GeometryData::TETRA_MESH:
45 case Ra::Core::Asset::GeometryData::HEX_MESH:
46 case Ra::Core::Asset::GeometryData::UNKNOWN:
48 CORE_ASSERT(
false,
"unsupported geometry" );
50 registerComponent( entity, comp );
53 auto volumeData = fileData->getVolumeData();
57 for (
const auto& data : volumeData ) {
59 auto comp =
new VolumeComponent( componentName, entity, data );
60 registerComponent( entity, comp );
This class allows tasks to be registered and then executed in parallel on separate threads.
hepler function to manage enum as underlying types in VariableSet
Structure passed to each system before they fill the task queue.