Skip to main content

Module scene_walk

Module scene_walk 

Source
Expand description

Shared scene traversal + transform helpers (M-TEXT.0 / AUT-74).

Before this module, sprite_pipeline, graphics_pipeline, mesh_pipeline, and text_pipeline each duplicated the same pre-order subtree walk: stack-based DFS, exclude-set filter, visibility skip, parent-world transform accumulation, and a local mat3_to_mat4 helper. This module owns those mechanics so the upcoming text backends (AtlasText, FlexibleText) and any future pipeline pick them up for free.

No behavior change: every existing pipeline calls walk_visible_subtree with the same (id, node, world) callback semantics it had before.

Functions§

mat3_to_mat4 🔒
Lift a 2-D affine Mat3 into a 4-D homogeneous Mat4 for the WGPU-side vertex shaders that consume mat4s.
walk_visible_subtree 🔒
Walk every visible node in the subtree rooted at start in pre-order, calling visit with the node id, the borrowed Node, and its world-space transform (parent’s world × local).