benilla-re systems structs docs

LocateSplineSegmentUniform

function · spline · primitive

Address
0x4538c0 · 84 bytes, up to 0x453913
Signature
void __stdcall (float t, uint32_t n, uint32_t *index, float *frac)
Meaning
Splits [0, 1] into n equal parts and returns the part and local parameter of t
Confidence
verified, proof one
Finding
spline#arc-length-and-parameter
Test
spline::fixed_quantize_diff

Finding: Arc length and parameter in spline

0x453760(seg, table) returns the length of a segment as 20 chords: points at t = 0.05·k, each chord √((dz² + dy²) + dx²), the running sum stored as a float after each. 0x453840(t, _, n, &i, &f) finds the segment by arc length: n of 1 gives (0, t); else s = total·t and the stored lengths are added until s < running + length[i] or the last segment, f = (s − running)/length[i]. 0x4538c0(t, n, &i, &f) splits [0, 1] into n equal parts: i is byte 1 of the float bits of t·n + 512, f = (t − (1/n)·i)·n.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

Calls and jumps by a bare address, from tables/calls.tsv.