Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::ecs::Parent Struct Reference

Parent reference component. More...

#include <Hierarchy.hpp>

Public Member Functions

 Parent ()=default
 Parent (Entity e)

Public Attributes

Entity entity = INVALID_ENTITY
 Parent entity ID.

Detailed Description

Parent reference component.

Links an entity to its parent in the scene hierarchy. Used together with Children component to form a tree structure.

Entity parent = registry.create();
Entity child = registry.create();
registry.emplace<Parent>(child, parent);
registry.get<Children>(parent).entities.push_back(child);
Entity identifier with packed index + generation.
Definition Types.hpp:135
Children list component.
Definition Hierarchy.hpp:66

Definition at line 46 of file Hierarchy.hpp.

Constructor & Destructor Documentation

◆ Parent() [1/2]

esengine::ecs::Parent::Parent ( )
default

References Parent().

Referenced by Parent(), and Parent().

◆ Parent() [2/2]

esengine::ecs::Parent::Parent ( Entity e)
inlineexplicit

Definition at line 52 of file Hierarchy.hpp.

References Parent(), and entity.

Member Data Documentation

◆ entity

Entity esengine::ecs::Parent::entity = INVALID_ENTITY

The documentation for this struct was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/ecs/components/Hierarchy.hpp