feat!: Component system - #232
Draft
Felix Frank (feliopterix) wants to merge 31 commits into
Draft
Conversation
Documents the component system and adds a status note to the gizmo implementation, which is unreferenced on purpose while it awaits activation. - findEntity is backed by a Map instead of a full root traverse, which ran on every gizmo frame via object-transform -> UPDATE_OBJECT - AssetExporter hides everything outside the product layer while exporting, so the 1000x1000 floor plane and the point light handle stay out of the file - removes a WebXR clone block whose result was always discarded
MemberLinksComponent became MultiLineComponent: instead of one Line object per member, all lines share one LineSegments, so the whole set costs one draw call regardless of member count. - each line owns a fixed two-vertex slot; adding, moving or hiding a member rewrites only that slot and uploads only that range via addUpdateRange - freed slots are recycled and departing members collapse to zero length, so no other line is ever rewritten - lineDistance is written per line instead of via computeLineDistances, which accumulates across segments and can drop a short line into a dash gap - points stay in owner-local space, so moving the group itself touches no buffer
MultiLineComponent was doing three jobs: drawing lines, watching the owner's child nodes, and knowing that a group link runs from the origin to a member. Only the first is a drawing primitive's business. - MultiLineComponent now takes points and hands out line handles. It watches nothing and knows nothing about nodes, so it is reusable for any set of cheap lines - GroupLinksComponent owns the group semantics: it tracks membership, refreshes a line when a member moves, and drives the line component. It brings one along if the node has none, and only disposes it if it created it - clearLines() rather than clear(), which is Object3D's and removes children
A component must never attach another component, and the engine must not know what a group is. GroupLinksComponent broke both, so it is gone. - a group node now carries nothing but a MultiLineComponent, which draws lines and watches nothing - the gateway owns every piece of group knowledge: _setParent adds and removes member lines, the object-transform listener redraws a dragged member, _apply redraws after a position patch, and bbVisible toggles visibility - drops DIVEComponent.onChildNodeTransform and DIVENode's dispatcher for it, which existed only for this one case
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #232 +/- ##
==========================================
- Coverage 99.69% 99.68% -0.01%
==========================================
Files 141 154 +13
Lines 7435 8235 +800
Branches 1723 1964 +241
==========================================
+ Hits 7412 8209 +797
- Misses 23 26 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Felix Frank (feliopterix)
force-pushed
the
feat/component-system
branch
from
August 14, 2026 11:41
7f1690a to
c344d9c
Compare
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.
1. Why is this change necessary?
DIVE should move more in direction of a state-of-the-art framework with a component system like in common game engines like Unreal or Unity. A component system is a proven concept and convinces in terms of usability, clear-code and performance.
We want to change DIVE's engine components (like DIVEModel or DIVEPrimitive) to become components. Components are attached to Nodes only. Nodes can be attached to Nodes as well. So the scene hierarchy becomes more simple: we only have Nodes in the tree and a Node can also have components that transport the actual logical behaviour. Node therefore are just transporting transformation (world and local).
2. What does this change do, exactly?
3. Describe each step to reproduce the issue or behaviour.
4. Please link to the relevant issues (if any).
5. Checklist