Runaway guard for emit_nines_geometry: repeats per axis are clamped to
this, and a centre whose repeat count exceeds NINES_MAX_TILE_QUADS falls
back to a single stretched quad. Authored content never reaches either — a
4096 px part filled by a 16 px source slice needs 256 repeats — they only
stop degenerate data (a near-zero source slice) from exhausting memory.
Computes the local UV coordinates for a part, including UV animation (translate, rotate, scale) and flipping.
Returns a tuple containing the u and v coordinates for the 5 vertices.
Computes the local vertices for a part, including pivot calculation and deformations.
Utilizes SIMD via the wide crate for maximum performance.
Returns a tuple containing the x and y coordinates of the 5 vertices.
Computes the slice lines for a Nine-Slice part.
size: (width, height) of the part — must be non-zero.
cell_rect: (left, top, right, bottom) of the source cell, in texture pixels.
margins: (left, top, right, bottom) authored margins, in source pixels.
Rigidly transforms a Deform-only mesh’s rest vertices by the part’s world
matrix — out = W · rest for every vertex. SoA layout in and out,
computed four vertices at a time with f32x4; the contiguous SoA loads
keep the input gather vectorizable. The per-frame deform delta is a sparse
scatter and is applied separately (scalar) by the caller.
Performs a hit test for a point against a 4-point quadrilateral in world space.
Uses the even-odd rule (ray casting) algorithm and SIMD via the wide crate to support both convex and concave quadrilaterals efficiently.
Performs a hit test for a point against a rectangle in local space.
The point is expected to be already transformed into local space (using inverse matrix).
Some((tan(skew_x), tan(skew_y))) when a part’s Skew must be applied as a
local-vertex shear, or None when there is no skew or when Skew runs in
propagate mode (folded into the world matrix instead). See
crate::eval::SKEW_PROPAGATES. Angles are in degrees.
Shears one local-space vertex about the pivot origin, in the part’s Y-up
authored space — callers apply the Y-down flip afterwards, exactly as they
do for the 4-corner Vertex deform, so the sign matches that path. tan_x /
tan_y come from skew_local_tans. This is the same shear the world
matrix applies in propagate mode: (x, y) -> (x + tan_x·y, y + tan_y·x).