hx3d
1
2D/3D Simple Game Framework
|
Node management in hierarchy. More...
#include <scene_graph.hpp>
Public Member Functions | |
template<class T , class... Args> | |
Ptr< T > | createAtRoot (Args...args) |
Create a game object at the root. More... | |
template<class T , class... Args> | |
Ptr< T > | create (const std::string path, Args...args) |
Create a game object at a path. More... | |
void | remove (const std::string path) |
Remove a game object from a path. More... | |
template<class T > | |
Ptr< T > | fetch (const std::string path) |
Fetch a game object from a path. More... | |
Ptr< Node > | getRoot () |
Get the root. More... | |
unsigned int | getNodeCount () |
Get the number of nodes. More... | |
void | showIndices () |
Show the graph indices. | |
void | draw (graphics::BaseBatch &batch) |
Draw the nodes. More... | |
void | update (const float delta) |
Update the nodes. More... | |
void | setEntityMode (bool enabled) |
Activate/Deactivate the entity management mode. More... | |
Protected Member Functions | |
void | addIndex (const Ptr< Node > &object) |
Add an index to the graph. More... | |
Ptr< Node > | pathExists (const std::string path) |
Test if the path exists and returns the node. More... | |
void | internalRemove (const Ptr< Node > &node) |
Remove a node. More... | |
template<class T , class... Args> | |
Ptr< T > | createNodeChild (const Ptr< Node > &container, Args...args) |
Create a child for a container Node. More... | |
Protected Attributes | |
Ptr< Node > | _root |
Graph root. | |
std::map< std::string, Ptr< Node > > | _indices |
Node indices. | |
Engine | _engine |
Engine for entity management. | |
bool | _entityEnabled |
Is entity management enabled ? | |
Node management in hierarchy.
The SceneGraph is merged with an Engine, to do cross-entity management. It is activable with setEntityMode.
Definition at line 43 of file scene_graph.hpp.
Add an index to the graph.
object | Node (Ptr) |
Definition at line 49 of file scene_graph.cpp.
Ptr< T > hx3d::ecs::SceneGraph::create | ( | const std::string | path, |
Args... | args | ||
) |
Create a game object at a path.
path | Path |
args | Arguments |
Definition at line 33 of file scene_graph.inl.hpp.
Ptr< T > hx3d::ecs::SceneGraph::createAtRoot | ( | Args... | args | ) |
Create a game object at the root.
args | Arguments |
Definition at line 27 of file scene_graph.inl.hpp.
|
protected |
Create a child for a container Node.
container | Container node |
args | Arguments |
Definition at line 50 of file scene_graph.inl.hpp.
void hx3d::ecs::SceneGraph::draw | ( | graphics::BaseBatch & | batch | ) |
Ptr< T > hx3d::ecs::SceneGraph::fetch | ( | const std::string | path | ) |
Fetch a game object from a path.
path | Path |
Definition at line 45 of file scene_graph.inl.hpp.
unsigned int hx3d::ecs::SceneGraph::getNodeCount | ( | ) |
Test if the path exists and returns the node.
path | Path |
Definition at line 142 of file scene_graph.cpp.
void hx3d::ecs::SceneGraph::remove | ( | const std::string | path | ) |
Remove a game object from a path.
path | Path |
Definition at line 106 of file scene_graph.cpp.
void hx3d::ecs::SceneGraph::setEntityMode | ( | bool | enabled | ) |
Activate/Deactivate the entity management mode.
enabled | Enabled ? |
Definition at line 37 of file scene_graph.cpp.
void hx3d::ecs::SceneGraph::update | ( | const float | delta | ) |