Path index over a loaded scene graph: path ā { node, worldNdTransform }.
Every view derivation needs the node at a path and the world nD transform
composed from the root down to it. Walking the graph for each
(computeWorldNdTransform, a depth-first search from the root) made one
pass O(N²) on a many-part partition: every part's derivation walked every
other part. The SceneNode graph is built once by buildSceneGraph and never
mutated afterwards (deferred activations build THREE objects and loaders,
not SceneNodes), so the index is computed once, right after the build, and
every lookup is O(1). The same pass records each node's ancestor chain, so
attribute composition (effective-attrs.ts) costs O(depth) per node rather
than a linear children.find descent per level.
Results are identical to the walk: a path that occurs twice resolves to its
first occurrence in depth-first pre-order (the walk's first match), an
unknown path has the identity transform ({}), and a node reached twice ā
a cycle or a shared subtree ā is refused with the walk's error.
Path index over a loaded scene graph:
path ā { node, worldNdTransform }.Every view derivation needs the node at a path and the world nD transform composed from the root down to it. Walking the graph for each (
computeWorldNdTransform, a depth-first search from the root) made one pass O(N²) on a many-part partition: every part's derivation walked every other part. The SceneNode graph is built once bybuildSceneGraphand never mutated afterwards (deferred activations build THREE objects and loaders, not SceneNodes), so the index is computed once, right after the build, and every lookup is O(1). The same pass records each node's ancestor chain, so attribute composition (effective-attrs.ts) costs O(depth) per node rather than a linearchildren.finddescent per level.Results are identical to the walk: a path that occurs twice resolves to its first occurrence in depth-first pre-order (the walk's first match), an unknown path has the identity transform (
{}), and a node reached twice ā a cycle or a shared subtree ā is refused with the walk's error.