|
Aeon Engine c550894
AeonGames Open Source Game Engine
|
Scene graph node representing an entity in the game world. More...
#include <aeongames/Node.hpp>

Public Types | |
| enum | FlagBits { EnabledBit = 1 , VisibleBit = 2 , AllBits = 3 } |
| Bitmask values for node flags. More... | |
| enum | Flags { Enabled = 0 , Visible , FlagCount } |
| Individual flag indices for use with SetFlag/IsFlagEnabled. More... | |
Public Member Functions | |
| DLL | Node (uint32_t aFlags=AllBits) |
| Construct a node with the given initial flags. | |
| DLL void | SetName (const std::string &aName) |
| Set the name of this node. | |
| DLL const std::string & | GetName () const |
| Get the name of this node. | |
| DLL void | Serialize (NodeMsg &aNodeMsg) const |
| Serialize this node's state into a protobuf message. | |
| DLL void | Deserialize (const NodeMsg &aNodeMsg) |
| Deserialize this node's state from a protobuf message. | |
| DLL void | SetFlags (uint32_t aFlagBits, bool aEnabled=true) |
| Enables or disables a set of node flags. | |
| DLL void | SetFlag (enum Flags aFlag, bool aEnabled=true) |
| Enables or disables a single node flag. | |
| DLL bool | IsFlagEnabled (enum Flags aFlag) const |
| Check whether a specific flag is enabled. | |
| DLL Node * | Add (std::unique_ptr< Node > aNode) |
| Append a child node. | |
| DLL Node * | Insert (size_t aIndex, std::unique_ptr< Node > aNode) |
| Insert a child node at a specific index. | |
| DLL std::unique_ptr< Node > | Remove (Node *) |
| Remove a child node by pointer. | |
| DLL std::unique_ptr< Node > | RemoveByIndex (size_t aIndex) |
| Remove a child node by index. | |
| DLL Scene * | GetScene () const |
| Retrieve a pointer to the scene containing the node instance. | |
| DLL void | LoopTraverseDFSPreOrder (const std::function< void(Node &) > &aAction) |
| Iterative depth first search iteration. | |
| DLL void | LoopTraverseDFSPreOrder (const std::function< void(Node &) > &aPreamble, const std::function< void(Node &) > &aPostamble) |
| Iterative depth first search iteration. | |
| DLL void | LoopTraverseDFSPreOrder (const std::function< void(const Node &) > &aAction) const |
| Constant version of LoopTraverseDFSPreOrder. | |
| DLL void | LoopTraverseDFSPostOrder (const std::function< void(Node &) > &aAction) |
| Iterative depth first search iteration. | |
| DLL void | LoopTraverseDFSPostOrder (const std::function< void(const Node &) > &aAction) const |
| Constant version of LoopTraverseDFSPostOrder. | |
| DLL void | RecursiveTraverseDFSPreOrder (const std::function< void(Node &) > &aAction) |
| Recursive depth first search iteration. | |
| DLL void | RecursiveTraverseDFSPostOrder (const std::function< void(Node &) > &aAction) |
| Recursive depth first search iteration. | |
| DLL void | LoopTraverseAncestors (const std::function< void(Node &) > &aAction) |
| Traverse ancestors iteratively, calling an action on each. | |
| DLL void | LoopTraverseAncestors (const std::function< void(const Node &) > &aAction) const |
| Traverse ancestors iteratively (const version). | |
| DLL void | RecursiveTraverseAncestors (const std::function< void(Node &) > &aAction) |
| Traverse ancestors recursively, calling an action on each. | |
| DLL Node * | Find (const std::function< bool(const Node &) > &aUnaryPredicate) const |
| Find a descendant node matching a predicate. | |
| DLL const Transform & | GetLocalTransform () const |
| Get the local transform relative to the parent. | |
| DLL const Transform & | GetGlobalTransform () const |
| Get the global (world-space) transform. | |
| DLL const AABB & | GetAABB () const |
| Get the axis-aligned bounding box. | |
| DLL void | SetLocalTransform (const Transform &aTransform) |
| Set the local transform relative to the parent. | |
| DLL void | SetGlobalTransform (const Transform &aTransform) |
| Set the global (world-space) transform. | |
| DLL void | SetAABB (const AABB &aAABB) |
| Set the axis-aligned bounding box. | |
| DLL size_t | GetChildrenCount () const |
| Get the number of direct child nodes. | |
| DLL Node * | GetChild (size_t aIndex) const |
| Get a child node by index. | |
| DLL const Node & | operator[] (const std::size_t index) const |
| Access a child node by index (const). | |
| DLL Node & | operator[] (const std::size_t index) |
| Access a child node by index. | |
| DLL NodeParent | GetParent () const |
| Get this node's parent. | |
| DLL size_t | GetIndex () const |
| Get this node's index within its parent's child list. | |
| DLL uint32_t | GetId () const |
| Get the unique identifier of this node. | |
| DLL void | Update (const double delta) |
| Update this node and its children. | |
| DLL void | Render (Renderer &aRenderer, void *aWindowId) const |
| Render this node and its children. | |
| DLL void | ProcessMessage (uint32_t aMessageType, const void *aMessageData) |
| Deliver a message to this node and its components. | |
Node Data | |
| DLL Component * | AddComponent (std::unique_ptr< Component > aComponent) |
| Add a component to this node. | |
| DLL size_t | GetComponentCount () const |
| Get the number of components attached to this node. | |
| DLL Component * | GetComponentByIndex (size_t aIndex) const |
| Get a component by its index. | |
| DLL Component * | GetComponent (uint32_t aId) const |
| Get a component by its type identifier. | |
| DLL std::unique_ptr< Component > | RemoveComponent (uint32_t aId) |
| Remove a component by its type identifier. | |
Friends | |
| class | Scene |
Scene graph node representing an entity in the game world.
Nodes form a hierarchical tree structure and can hold components, transforms, and bounding volumes.
| AeonGames::Node::Node | ( | uint32_t | aFlags = AllBits | ) |
| void AeonGames::Node::Deserialize | ( | const NodeMsg & | aNodeMsg | ) |
| const AABB & AeonGames::Node::GetAABB | ( | ) | const |
| Node * AeonGames::Node::GetChild | ( | size_t | aIndex | ) | const |
| size_t AeonGames::Node::GetChildrenCount | ( | ) | const |
| Component * AeonGames::Node::GetComponent | ( | uint32_t | aId | ) | const |
| Component * AeonGames::Node::GetComponentByIndex | ( | size_t | aIndex | ) | const |
| size_t AeonGames::Node::GetComponentCount | ( | ) | const |
| const Transform & AeonGames::Node::GetGlobalTransform | ( | ) | const |
| uint32_t AeonGames::Node::GetId | ( | ) | const |
| size_t AeonGames::Node::GetIndex | ( | ) | const |
| const Transform & AeonGames::Node::GetLocalTransform | ( | ) | const |
| const std::string & AeonGames::Node::GetName | ( | ) | const |
| NodeParent AeonGames::Node::GetParent | ( | ) | const |
Get this node's parent.
| Scene * AeonGames::Node::GetScene | ( | ) | const |
| bool AeonGames::Node::IsFlagEnabled | ( | enum Flags | aFlag | ) | const |
| void AeonGames::Node::LoopTraverseAncestors | ( | const std::function< void(const Node &) > & | aAction | ) | const |
| void AeonGames::Node::LoopTraverseAncestors | ( | const std::function< void(Node &) > & | aAction | ) |
| DLL void AeonGames::Node::LoopTraverseDFSPostOrder | ( | const std::function< void(Node &) > & | aAction | ) |
Iterative depth first search iteration.
Iterates all descendants without recursion in post-order. This function guarrantees that children are processed before their parent.
| aAction | a function, function pointer or function like object to proccess each child node. |
| DLL void AeonGames::Node::LoopTraverseDFSPreOrder | ( | const std::function< void(Node &) > & | aAction | ) |
Iterative depth first search iteration.
Iterates all descendants without recursion in pre-order. This function guarrantees that parents are processed before their children.
| aAction | a function, function pointer or function like object to proccess each child node. |
| void AeonGames::Node::LoopTraverseDFSPreOrder | ( | const std::function< void(Node &) > & | aPreamble, |
| const std::function< void(Node &) > & | aPostamble ) |
Iterative depth first search iteration.
Iterates all descendants without recursion in pre-order. This function guarrantees that parents are processed before their children. This function does the same as the single argument version except that it runs two functions, a preamble upon reaching a node and a postamble upon leaving it having run the preambles and postambles of all of the node's children.
| aPreamble | a function, function pointer or function like object to run upon reaching each child node. |
| aPostamble | a function, function pointer or function like object to run upon leaving each child node. |
| Node & AeonGames::Node::operator[] | ( | const std::size_t | index | ) |
| const Node & AeonGames::Node::operator[] | ( | const std::size_t | index | ) | const |
| void AeonGames::Node::ProcessMessage | ( | uint32_t | aMessageType, |
| const void * | aMessageData ) |
| void AeonGames::Node::RecursiveTraverseAncestors | ( | const std::function< void(Node &) > & | aAction | ) |
| DLL void AeonGames::Node::RecursiveTraverseDFSPostOrder | ( | const std::function< void(Node &) > & | aAction | ) |
Recursive depth first search iteration.
Iterates all descendants with recursion in post-order. This function guarrantees that children are processed before their parent.
| aAction | a function, function pointer or function like object to proccess each child node. |
| void AeonGames::Node::RecursiveTraverseDFSPreOrder | ( | const std::function< void(Node &) > & | aAction | ) |
Recursive depth first search iteration.
Iterates all descendants with recursion in pre-order. This function guarrantees that parents are processed before their children.
| aAction | a function, function pointer or function like object to proccess each child node. |
| std::unique_ptr< Node > AeonGames::Node::RemoveByIndex | ( | size_t | aIndex | ) |
| std::unique_ptr< Component > AeonGames::Node::RemoveComponent | ( | uint32_t | aId | ) |
| void AeonGames::Node::Render | ( | Renderer & | aRenderer, |
| void * | aWindowId ) const |
| void AeonGames::Node::Serialize | ( | NodeMsg & | aNodeMsg | ) | const |
| void AeonGames::Node::SetAABB | ( | const AABB & | aAABB | ) |
| void AeonGames::Node::SetFlag | ( | enum Flags | aFlag, |
| bool | aEnabled = true ) |
| void AeonGames::Node::SetFlags | ( | uint32_t | aFlagBits, |
| bool | aEnabled = true ) |
| void AeonGames::Node::SetGlobalTransform | ( | const Transform & | aTransform | ) |
Set the global (world-space) transform.
| aTransform | The new global transform. |
| void AeonGames::Node::SetLocalTransform | ( | const Transform & | aTransform | ) |
| void AeonGames::Node::SetName | ( | const std::string & | aName | ) |
| void AeonGames::Node::Update | ( | const double | delta | ) |