Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Entities::SceneGraph Class Reference

Represents the entire scene as a graph (specifically, a tree) of SceneNode objects. It manages the hierarchy of nodes and provides access to the root of the scene. More...

#include <SceneGraph.h>

Collaboration diagram for Engine::Entities::SceneGraph:

Public Member Functions

 SceneGraph (const std::shared_ptr< SceneNode > &root)
 Constructs a new Scene Graph object, initializing the root node.
const std::shared_ptr< SceneNode > & getRoot () const
 Gets the root node of the scene graph.
void reserveRootChildren (size_t additionalChildren)
 Reserves space for additional root children to avoid reallocations during bulk spawning.
std::shared_ptr< SceneNodecreateNode (const Ecs::Transform &transform, const std::shared_ptr< SceneNode > &parent, bool disableCaching=false)
 Creates a node which tells you where an object is in the scene.

Private Attributes

std::shared_ptr< SceneNoderoot_

Detailed Description

Represents the entire scene as a graph (specifically, a tree) of SceneNode objects. It manages the hierarchy of nodes and provides access to the root of the scene.

Definition at line 194 of file SceneGraph.h.

Constructor & Destructor Documentation

◆ SceneGraph()

Engine::Entities::SceneGraph::SceneGraph ( const std::shared_ptr< SceneNode > & root)
explicit

Constructs a new Scene Graph object, initializing the root node.

Member Function Documentation

◆ createNode()

std::shared_ptr< SceneNode > Engine::Entities::SceneGraph::createNode ( const Ecs::Transform & transform,
const std::shared_ptr< SceneNode > & parent,
bool disableCaching = false )

Creates a node which tells you where an object is in the scene.

Parameters
transformworld transform where the node should be
parentthe parent node
disableCachingif the node is updated each frame (eg controller or player) caching of the position can be disabled. This enables skipping the update when it is not dirty
Returns
The created SceneNode

◆ getRoot()

const std::shared_ptr< SceneNode > & Engine::Entities::SceneGraph::getRoot ( ) const
inlinenodiscard

Gets the root node of the scene graph.

Returns
A const reference to the unique_ptr holding the root SceneNode.

Definition at line 205 of file SceneGraph.h.

References root_.

◆ reserveRootChildren()

void Engine::Entities::SceneGraph::reserveRootChildren ( size_t additionalChildren)

Reserves space for additional root children to avoid reallocations during bulk spawning.

Member Data Documentation

◆ root_

std::shared_ptr<SceneNode> Engine::Entities::SceneGraph::root_
private

Definition at line 195 of file SceneGraph.h.

Referenced by getRoot().


The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/World/SceneGraph.h