Skip to content

Commit

Permalink
Merge pull request #65 from hotstreams/fix/hidden-scene-instances
Browse files Browse the repository at this point in the history
fix hidden scene instances not being hidden
  • Loading branch information
hotstreams authored Jun 19, 2024
2 parents 4026338 + 08e46d7 commit aacdb3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/limitless/scene.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ namespace Limitless {
std::shared_ptr<Skybox>& getSkybox() noexcept;
void setSkybox(const std::shared_ptr<Skybox>& skybox);

/**
* Return visible scene instances.
*/
Instances getInstances() const noexcept;

void update(Context& context, const Camera& camera);
Expand Down
3 changes: 3 additions & 0 deletions src/limitless/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ Instances Scene::getInstances() const noexcept {
};

for (const auto& [_, instance] : instances) {
if (instance->isHidden()) {
continue;
}
visitor(*instance);
}

Expand Down

0 comments on commit aacdb3c

Please sign in to comment.