pub fn native_to_baked(
mesh_coordinate_space: MeshCoordinateSpace,
site_transform: Option<&[f64]>,
origin_shift: [f64; 3],
) -> [f64; 16]Expand description
The row-major 4x4 mapping a NATIVE-frame point (IFC Z-up, pre-RTC — the
frame InstanceMeta.transform and every captured local_to_world describe)
onto the BAKED point this pipeline actually writes into MeshData, for the
given coordinate-space tier.
One function, next to the converter that creates the divergence, so a consumer of baked vertices never re-derives the tier taxonomy by hand. What it encodes:
- the router subtracts the model RTC offset while baking, so every tier
carries
T(-origin_shift); site_localALSO runsconvert_mesh_to_site_local, which applies the site placement’s inverse rotationRᵀto positions, normals and the f64 origin — and in that tier the RTC offset IS the site translation (the three-tier selection inprocessor::modtakes it straight off the site matrix), so a baked point is exactlyRᵀ · (P − t_site);model_rtcandraw_ifcremove no rotation, so they areT(-origin_shift)alone.raw_ifcselectsorigin_shift = (0,0,0), which makes that the identity that tier is documented to be. The translation is still applied unconditionally, so a caller handing in a non-zero shift under some other tier string gets the frame its vertices are actually in rather than a silent identity.
Rᵀ is applied under exactly [rotation_is_identity]’s condition, because
that is the condition [apply_inverse_rotation_in_place] itself no-ops
under: the two must agree, or this basis describes a bake that did not
happen.
Row-major, to match the glTF exporter’s matrix module, which composes its Z-up→Y-up swap on top of this.