Entity Hierarchy & Scripting Integration
finally caved & added actual parent/child relationships to entities
changes
entity hierarchy
- entities can now have a parent & children via a new
RelationshipComponent.Registry::Reparent()handles moving an entity under a new parent, with cycle & self-parenting protection so you cant do anything silly like parenting an entity to its own descendant. -
TransformComponentnow has aworldTransformalongside the existing local one, a newHierarchySystem - systems that care about actual position (i.e
AISystem) readworldTransformnow instead of assuming local == world. - destroying an entity recursively destroys its children too & unlinks it from its parent’s child list
- scene serialization now saves & restores the hierarchy
editor
- the Registry panel is a proper collapsible tree now instead of a flat list
- drag & drop reparenting, plus a right click menu for “Create Child”, “Detach”, & “Set Parent”.
scripting
- pulled all the entity/component script bindings out into their own
EngineLibRegistry.cppmodule, they were kind of scattered around before & this makes them way easier to find & extend. - scripts can now walk the hierarchy too (get children, etc), same module.
- added
SetFont/GetFontbindings so scripts can assign or query a button’s font, small thing but script generated buttons wont have visible text without it :)
misc cleanup
- small modernization stuff while i was in these files anyway: dropped redundant ternary parens, swapped a bunch of
auto x = ...; if (x)into if-with-initializer, dropped some unnecessary global qualifiers, const-correctness fixes onUISystem::Update&UIRenderer::Flush.
(yes i know the gizmos are offset and buggy, i kind of forgot to update the gizmo code after changing transforms :p )
Comments 2
looking good!
looks peak, keep going!
Sign in to join the conversation.