Type
Overview
The ECS currently has no parent-child hierarchy between entities. Every entity is a root — the Outliner's flat list is a direct consequence. Adding a scene graph unblocks tree-view display in the Outliner, grouped transforms (e.g. a vehicle and its wheels), and instanced prefab attachment.
What's missing
1. ParentComponent and ChildrenComponent
struct ParentComponent { EntityID Parent = INVALID_ENTITY; };
struct ChildrenComponent { Core::Containers::Array<EntityID> Children; };
Nothing exists today to link entities in a hierarchy.
2. Local vs World transform split
TransformComponent currently stores one transform that is treated as both local and world (valid only because everything is a root). A scene graph needs:
TransformComponent — local (relative to parent); what the Inspector edits
WorldTransformComponent — computed by the propagation system; what the renderer reads
struct WorldTransformComponent {
Core::Maths::Mat4f Matrix = {}; // ParentWorld × TRS(local)
};
3. TransformDirtyComponent or dirty flag
Without a dirty flag, all transforms are recomputed every frame. A bool Dirty = true on TransformComponent (or a zero-size tag component) allows the propagation system to skip unchanged subtrees.
4. Transform propagation WorldTick system
A system that walks the hierarchy in depth order and writes WorldTransformComponent:
Pass 1 — roots (no ParentComponent): WorldMatrix = TRS(local)
Pass 2 — depth-1 children: WorldMatrix = Parent.WorldMatrix × TRS(local)
Pass N — repeat until no dirty flags remain
Topological sort or multi-pass with dirty flags; multi-pass is simpler to start.
5. Outliner tree view
Once ParentComponent exists, HierarchyViewUIComponent can render a tree (ImGui TreeNode) instead of a flat list. Drag-to-reparent becomes a context-menu or drag-drop operation.
Acceptance criteria
Depends on
Estimated effort
3–4 days
Type
Overview
The ECS currently has no parent-child hierarchy between entities. Every entity is a root — the Outliner's flat list is a direct consequence. Adding a scene graph unblocks tree-view display in the Outliner, grouped transforms (e.g. a vehicle and its wheels), and instanced prefab attachment.
What's missing
1.
ParentComponentandChildrenComponentNothing exists today to link entities in a hierarchy.
2. Local vs World transform split
TransformComponentcurrently stores one transform that is treated as both local and world (valid only because everything is a root). A scene graph needs:TransformComponent— local (relative to parent); what the Inspector editsWorldTransformComponent— computed by the propagation system; what the renderer reads3.
TransformDirtyComponentor dirty flagWithout a dirty flag, all transforms are recomputed every frame. A
bool Dirty = trueonTransformComponent(or a zero-size tag component) allows the propagation system to skip unchanged subtrees.4. Transform propagation WorldTick system
A system that walks the hierarchy in depth order and writes
WorldTransformComponent:Topological sort or multi-pass with dirty flags; multi-pass is simpler to start.
5. Outliner tree view
Once
ParentComponentexists,HierarchyViewUIComponentcan render a tree (ImGui TreeNode) instead of a flat list. Drag-to-reparent becomes a context-menu or drag-drop operation.Acceptance criteria
ParentComponentandChildrenComponentdefinedWorldTransformComponentdefined;TransformComponentexplicitly documented as local-onlyTransformPropagationSystemregistered inWorldTick; world transforms correct for 3+ levels of nestingWorldTransformComponentis whatFillRenderableTransformsand the render bridge read (notTransformComponent)Depends on
Estimated effort
3–4 days