From 5f51046e24eb25077375eae24e0765fe63bf5cbc Mon Sep 17 00:00:00 2001 From: asuessenbach Date: Tue, 22 Oct 2024 11:39:42 +0200 Subject: [PATCH] Extend supported classes in vkb::scene_graph::HPPScene::get_components and vkb::scene_graph::HPPScene::has_components --- framework/scene_graph/hpp_scene.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/framework/scene_graph/hpp_scene.h b/framework/scene_graph/hpp_scene.h index 0565e4dde..ab0aa65dc 100644 --- a/framework/scene_graph/hpp_scene.h +++ b/framework/scene_graph/hpp_scene.h @@ -17,8 +17,9 @@ #pragma once -#include "components/hpp_mesh.h" #include "scene.h" +#include "scene_graph/components/camera.h" +#include "scene_graph/components/hpp_mesh.h" #include "scene_graph/script.h" #include "scene_graph/scripts/animation.h" @@ -37,7 +38,8 @@ class HPPScene : private vkb::sg::Scene template std::vector get_components() const { - if constexpr (std::is_same::value) + if constexpr (std::is_same::value || std::is_same::value || std::is_same::value || + std::is_same::value || std::is_same::value) { return vkb::sg::Scene::get_components(); } @@ -56,10 +58,15 @@ class HPPScene : private vkb::sg::Scene template bool has_component() const { - if constexpr (std::is_same::value || std::is_same::value) + if constexpr (std::is_same::value || std::is_same::value || std::is_same::value || + std::is_same::value || std::is_same::value) { return vkb::sg::Scene::has_component(typeid(T)); } + else if constexpr (std::is_same::value) + { + return vkb::sg::Scene::has_component(); + } else { assert(false); // path never passed -> Please add a type-check here!