Skip to content

[Bugfix] Fix bounding box offset for multi-node models selected via scenegraph - #157

Merged
untoldengine merged 1 commit into
developfrom
patch/parent_aabb
Oct 8, 2026
Merged

untoldengine merged 1 commit into
developfrom
patch/parent_aabb

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

  • Selecting a dragged-in multi-node asset (e.g. goalpost.untold) via the scenegraph highlighted a bounding box offset from the visible mesh.
  • Root cause: accumulateBoundsInRootSpace/accumulateRenderableBoundsInRootSpace in SelectionManager.swift composed each child's bbox contribution using the parent's own local transform instead of the child's own local transform. This is invisible for a flat single-mesh entity, but a multi-node asset (container root + child mesh entities, each with their own local offset) got its highlight box computed as if children sat at the parent's own transform rather than their own.
  • Fix: in the children-recursion loop, fetch each child's own LocalTransformComponent and compose that with the accumulated chain, instead of reusing the current entity's transform.

Test plan

  • Added test_selectingAContainer_highlightsItsOffsetChildsMesh in SelectionSeveralTests.swift, reproducing the container-root + offset-child shape and reading back the GPU highlight buffer directly.
  • Verified the new test fails against the pre-fix code and passes with the fix.
  • Ran the full selection/gizmo/viewport test suites (233 tests) — all passing.

…cenegraph

Selecting a dragged-in multi-node asset (e.g. goalpost) in the scenegraph
highlighted a bounding box offset from the visible mesh. The highlight
accumulation composed each child's bbox contribution using the parent's
own local transform instead of the child's, so a mesh living on a child
entity with its own position offset from its container root rendered its
box in the wrong place.
@untoldengine
untoldengine merged commit 25411aa into develop Oct 8, 2026
2 checks passed
@untoldengine
untoldengine deleted the patch/parent_aabb branch October 8, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant