HierarchyPanel walks IWorld.Roots/GameObject.Children recursively as
ImGui tree nodes, clicking one sets EditorState.Selected — the shared
selection the not-yet-built Inspector panel will read from the same
instance. PushID(go.GetHashCode()) scopes each node's ID by object
identity rather than name, since nothing stops two sibling GameObjects
sharing a Name and ImGui's default label-based IDs would otherwise merge
their open/selected state.
Also gives samples/WindowDemo/scene.json a child GameObject (offset,
half-scale, parented under Quad) — the existing scene only had one root,
nothing to show a tree with. Verified by screenshot: both quads render at
their correct composed WorldMatrix (the child visibly smaller and offset,
confirming parent/child composition is still correct through this
change), and Hierarchy lists "Quad" as a collapsible node.
Full suite still green: 65 tests.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1qPfzq8TDCUMFMV3UwV5N
Replaces M2's single hardcoded NDC-space triangle with a real perspective
pipeline: ICameraService/CameraService (fixed camera at (0,3,6) looking at
the origin), a QuadRenderer marker component, and a Draw() that iterates
world.Query<QuadRenderer>() to draw every such GameObject at its own
WorldMatrix. Needed as the foundation for M3's gizmos, which have to map
a screen-space drag onto a real 3D axis — a 2D quad and no camera can't
support that.
Two real bugs found and fixed empirically, not designed in from the start:
- SystemAccessScope correctly threw on Draw() querying QuadRenderer without
declaring Reads<QuadRenderer>() on its Schedule.Add registration — the
safety net catching a real omission, exactly as designed.
- UniformMatrix4 needed transpose:true, not false. System.Numerics.Matrix4x4
is row-major in memory; glUniformMatrix4fv with transpose=GL_FALSE reads
that layout as column-major instead. With transpose=false the quad simply
didn't render — no error, no crash, just a blank screen. Confirmed via a
correctly perspective-foreshortened, texture-mapped quad after the fix.
Also adds samples/WindowDemo/scene.json (a single Quad GameObject with a
QuadRenderer) so the new pipeline has something real to draw, loaded via
the existing --scene flag.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1qPfzq8TDCUMFMV3UwV5N