Skip to main content

CullNoneStrategy.ixx File

Frustum culling strategy that returns all nodes (no culling). More...

Included Headers

Namespaces Index

namespacehelios
namespacescene

Scene graph and camera management. More...

Classes Index

classCullNoneStrategy

A default FrustumCullingStrategy that simply returns all SceneNodes found, e.g. no culling is applied. More...

Description

Frustum culling strategy that returns all nodes (no culling).

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file CullNoneStrategy.ixx
3 * @brief Frustum culling strategy that returns all nodes (no culling).
4 */
5module;
6
7#include <vector>
8
9export module helios.scene.CullNoneStrategy;
10
11import helios.scene.FrustumCullingStrategy;
12import helios.scene.CameraSceneNode;
13import helios.scene.SceneNode;
14
15export namespace helios::scene {
16
17
18 /**
19 * @brief A default FrustumCullingStrategy that simply returns all
20 * SceneNodes found, e.g. no culling is applied.
21 */
23
24
25 protected:
26 /**
27 * @brief Internal function to populate the vector recursively with the node and its children.
28 *
29 * @param nodes The vector holding the const pointers to the SceneNodes
30 * @param node The current node to process. This node is added to nodes, then this
31 * method is called for each child node of node.
32 */
33 void cull(
34 std::vector<const helios::scene::SceneNode*>& nodes, const SceneNode& node
35 ) const {
36 if (node.isActive()) {
37 nodes.push_back(&node);
38 }
39 for (auto& child: node.children()) {
40 cull(nodes, *child);
41 }
42 }
43
44
45 public:
46
47 /**
48 * @brief Returns all SceneNode of the specified scene, regardless of their visibility
49 * relative to the CameraSceneNode's camera view frustum.
50 *
51 * @param cameraSceneNode The camera defining the view frustum.
52 * @param root The parent of the hierarchy to cull.
53 *
54 * @return A vector with const pointers to the SceneNodes found under `root`.
55 */
56 [[nodiscard]] std::vector<const helios::scene::SceneNode*> cull(
57 const helios::scene::CameraSceneNode* cameraSceneNode, const helios::scene::SceneNode& root
58 ) override {
59
60 auto nodes = std::vector<const helios::scene::SceneNode*>();
61
62 cull(nodes, root);
63
64 return nodes;
65 }
66
67
68 };
69}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.