/** * Build an SoA {@link TransformStore} from a live scene subtree. * * This is the bridge between the `Entity` tree and the WASM/JS transform core: * it reads each entity's local transform (`x/y/scaleX/scaleY/rotation/opacity`) * and emits the flat `InputNode[]` that {@link buildStore} turns into the * depth-ordered, contiguous-sibling-run layout the kernel requires. It returns a * map from `Entity` to its store index so a caller can read each entity's world * matrix back out of `store.worldView()`/`store.wa…` after composition. * * The passed `root` becomes store index 0 at the identity world transform — its * own local transform is ignored, matching how `Scene` seeds `renderNode` with * the identity for `root`/`overlayRoot`. It touches no render state; wiring it * into `Scene.render` is a separate, flagged step. */ import type { Entity } from '../tree/Entity'; import { type TransformStore } from './soa'; export interface TreeStore { store: TransformStore; /** Entity -> its index in `store` (into `wa…`/`worldView`). */ indexOf: Map; } /** * Walk `root` and all descendants (via `entity.children`) into an SoA store. * Time O(n) in the subtree size; allocates one store per call (Stage 1 rebuilds * per frame — Stage 3 will cache on structural change). */ export declare function buildTreeStore(root: Entity): TreeStore;