Skip to content

feat!: Component system - #232

Draft
Felix Frank (feliopterix) wants to merge 31 commits into
trunkfrom
feat/component-system
Draft

feat!: Component system#232
Felix Frank (feliopterix) wants to merge 31 commits into
trunkfrom
feat/component-system

Conversation

@feliopterix

@feliopterix Felix Frank (feliopterix) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

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?

  • Adds components to DIVE.
  • Adds Nodes as only trunks for components.
  • Change State plugin to work correctly with components.
  • Removes additional transformational behaviour from former logical classes.
  • Removes logical behaviour from Nodes.

3. Describe each step to reproduce the issue or behaviour.

4. Please link to the relevant issues (if any).

5. Checklist

  • I have rebased my changes to remove merge conflicts
  • I have written tests and verified that they fail without my change
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfil them.

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
@feliopterix Felix Frank (feliopterix) added the service/shopping-experience Issues and PRs related to this service. label Aug 14, 2026
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.93146% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.68%. Comparing base (d33e39c) to head (c344d9c).
⚠️ Report is 22 commits behind head on trunk.

Files with missing lines Patch % Lines
src/plugins/toolbox/src/transform/TransformTool.ts 92.30% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@feliopterix Felix Frank (feliopterix) changed the title feat: Component system feat!: Component system Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service/shopping-experience Issues and PRs related to this service.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant