|
The Table Engine
|
Represents a node in the scene graph, encapsulating a game object and its hierarchy. More...
#include <scene.h>
Collaboration diagram for SceneNode:Public Member Functions | |
| SceneNode (GameObject *gameObject) | |
| Constructor that assigns a game object to this node. More... | |
| void | addChild (GameObject *child, bool isBackground=false) |
| Adds a child game object to this node. More... | |
| const std::vector< SceneNode * > | getChildren () |
| Returns the children of this node. More... | |
| SceneNode * | getParent () |
| Gets the parent of this node. More... | |
| GameObject * | getGameObject () |
| Gets the GameObject associated with this node. More... | |
| bool | readyToDestroy () |
| Checks if this node is marked for destruction. More... | |
| void | setDestroy (bool destroy) |
| Sets the destruction state of this node. More... | |
| bool | isBackground () |
| Checks if this node is part of the background. More... | |
| void | setIsBackground (bool isBackground) |
| Sets whether this node is part of the background. More... | |
Private Member Functions | |
| ~SceneNode () | |
| Destructor, ensures proper cleanup of node resources. This destructor is private to ensure that SceneNode objects are managed correctly through smart pointers or specific management functions in the SceneTree class. More... | |
Private Attributes | |
| SceneNode * | m_parent |
| Pointer to the parent node in the scene graph. More... | |
| GameObject * | m_gameObject |
| Pointer to the GameObject this node represents. More... | |
| std::vector< SceneNode * > | m_children |
| List of child nodes. More... | |
| bool | m_destroy = false |
| Flag to indicate whether this node is scheduled for destruction. More... | |
| bool | m_isBackground = false |
| Flag to indicate whether this node is part of the background. More... | |
Friends | |
| class | SceneTree |
| class | SceneManager |
Represents a node in the scene graph, encapsulating a game object and its hierarchy.
SceneNode provides functionality to manage a hierarchy of game objects, including adding children, managing lifecycle states, and setting background status.
| SceneNode::SceneNode | ( | GameObject * | gameObject | ) |
Constructor that assigns a game object to this node.
| gameObject | Pointer to the GameObject associated with this node. |
|
private |
| void SceneNode::addChild | ( | GameObject * | child, |
| bool | isBackground = false |
||
| ) |
Adds a child game object to this node.
| child | Pointer to the child GameObject to add. |
| isBackground | Flag indicating if the child is part of the background. |
| const std::vector< SceneNode * > SceneNode::getChildren | ( | ) |
| GameObject * SceneNode::getGameObject | ( | ) |
Gets the GameObject associated with this node.
| SceneNode * SceneNode::getParent | ( | ) |
| bool SceneNode::isBackground | ( | ) |
| bool SceneNode::readyToDestroy | ( | ) |
| void SceneNode::setDestroy | ( | bool | destroy | ) |
| void SceneNode::setIsBackground | ( | bool | isBackground | ) |
|
friend |
|
private |
|
private |
|
private |
Pointer to the GameObject this node represents.
|
private |
|
private |