diff --git a/include/limitless/scene.hpp b/include/limitless/scene.hpp index 8b936df8..7fed8bf4 100644 --- a/include/limitless/scene.hpp +++ b/include/limitless/scene.hpp @@ -54,6 +54,9 @@ namespace Limitless { std::shared_ptr& getSkybox() noexcept; void setSkybox(const std::shared_ptr& skybox); + /** + * Return visible scene instances. + */ Instances getInstances() const noexcept; void update(Context& context, const Camera& camera); diff --git a/src/limitless/scene.cpp b/src/limitless/scene.cpp index cffee1e6..a338d0fc 100644 --- a/src/limitless/scene.cpp +++ b/src/limitless/scene.cpp @@ -140,6 +140,9 @@ Instances Scene::getInstances() const noexcept { }; for (const auto& [_, instance] : instances) { + if (instance->isHidden()) { + continue; + } visitor(*instance); }