You are browsing as a guest. Sign up (or log in) to start making projects!

3h 7m 43s logged

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.
  • TransformComponent now has a worldTransform alongside the existing local one, a new HierarchySystem
  • systems that care about actual position (i.e AISystem) read worldTransform now 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.cpp module, 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/GetFont bindings 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 on UISystem::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 )

0
31

Comments 2

@ar-bh

looking good!

@f

looks peak, keep going!