Repository navigation
Conversation
Rebuilt on the current scene graph (replaces the earlier draft). - Object: trailing return types; neither copyable nor movable (children, features and listeners refer to it; nothing moved Objects). - Traversal: for_each_descendant (pre-order, false skips a subtree), for_each_ancestor (false stops), find_descendant, is_descendant_of. Adopted for the ImGui drop/duplicate code, the Qt reparent check and MeshScene's light lookup. - Signals (sigslot): feature_added, feature_removing, child_added, child_removing (also on re-parenting) and destroying. A Signal<Owner> wrapper lets anyone connect but only Object emit. - FeatureIndex: Objects by exact feature type for a tracked tree. Fixes over the draft: destroyed Objects leave the index, re-tracking is a no-op, an Object with several features of one type is listed once and stays until the last goes, queries are documented as exact-type. - Dropped from the draft: the per-Object type map in find_feature (it returned the last rather than first feature of a type and broke after removals; objects have a handful of features) and the unused AbstractFeature::on_modified.
mtao
force-pushed
the
feature/entity-system
branch
from
October 14, 2026 16:17
49f9a2c to
244307b
Compare
Base automatically changed from
refactor/value-returns
to
feature/controls-model
October 15, 2026 02:53
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #26 (and through it on
feature/controls-model). This replaces the earlier draft of this PR: it is rebuilt on the current scene graph, keeps the useful parts, and fixes or drops the rest.Object
Object, so moving one was never safe, and nothing in the codebase moved one. This also removes the draft's problem of signal connections and index pointers going stale after a move.Traversal
for_each_descendant(pre-order; returnfalseto skip a subtree),for_each_ancestor(returnfalseto stop),find_descendant, andis_descendant_of.These replace hand-written walks in:
MeshScene's first-light lookupCode that iterates direct children (row counts, root-level mesh lists) stays as it is.
Signals
Built on sigslot v1.2.3, added as a wrap.
feature_added/feature_removingchild_added/child_removing, also emitted when re-parentingdestroying, emitted at the start of destruction. The destroyed object's own features and children go with it without per-item signals; each child emits its owndestroying.A small
Signal<Owner, Args...>wrapper lets anyoneconnect/disconnectbut onlyObjectemit, so listeners can trust an event really happened. In the draft, the signals were public members anyone could fire.FeatureIndex
Maps each feature type to the objects in a tracked tree that carry a feature of exactly that type:
track(root),objects_with<F>(),count<F>().Fixes over the draft:
Object*.Dropped from the draft
find_feature. It returned the last feature of a type instead of the first, and missed features after a removal. Objects have a handful of features, so the linear scan is already cheap.AbstractFeature::on_modified/mark_modified(). Nothing called them.MeshGeometryandBasicShadinguse version counters for change tracking.Tests
is_descendant_of.emitisn't accessible outsideObject; thatObjectisn't copyable or movable.FeatureIndex: existing and later features, several features of one type, new, detached and re-attached children, exact-type queries, and either side being destroyed first.meson test: 13/13 suites pass.test_scene_graph: 591 assertions in 67 test cases.