rotation_angle_about_z

Function rotation_angle_about_z 

Source
pub fn rotation_angle_about_z(matrix: &[f64; 16]) -> Option<f64>
Expand description

The building/site rotation about the world vertical (Z) axis, derived from a resolved column-major 4×4 placement matrix (as returned by crate::GeometryRouter::resolve_scaled_placement). The local X-axis (the placement’s RefDirection, composed through the full parent chain and normalized) is column 0 — elements [0], [1], [2] — so its angle in the world XY plane is atan2(m[1], m[0]).

This is the single source of truth for site rotation: the processor consumes the full matrix (baking the inverse rotation into vertices for the site_local frame) while the viewer takes this angle for its render-frame rotation — both off the same resolved matrix, so they cannot drift on nested, scaled, or tilted-axis placements (where atan2 of the raw top-level RefDirection is incomplete). Returns None for a degenerate (zero-length) projected X-axis.