LocateSplineSegmentByLength
function · spline · primitive
- Address
0x453840· 124 bytes, up to0x4538bb- Signature
void __thiscall (void *this, float t, const float *table, uint32_t n, uint32_t *index, float *frac)- Meaning
- Finds the segment and local parameter of t along the stored lengths
- Confidence
- verified, proof one
- Finding
- spline#arc-length-and-parameter
- Test
spline::seg_locate_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
- LocateBezierByLength spline
- LocateCatmullRomByLength spline
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.