benilla-re systems structs docs

CM2Model::FindKey

function · models · primitive

Address
0x713d50 · 334 bytes, up to 0x713e9d
Meaning
Finds the key pair around a time in a track's range and the fraction between them
Confidence
verified, proof one
Finding
models/animation#key-lookup
Test
animation::m2_animate_difftest, animation::m2_track_sample_byte_difftest, animation::m2_track_sample_float_difftest, animation::m2_track_sample_quat_difftest, animation::m2_track_search_difftest

Finding: Key lookup in models: animation

FindKey(time, range, track) finds the key pair around a time. The range is the track's range for the sequence, or all keys; a global-sequence track uses its global time instead. It starts from the last key found: within 500 ms forward it steps forward, within 500 ms back it steps back; otherwise it steps forward from the range's first key when t is within 500 ms of it, and else binary-searches. The fraction is (t − t0) / (t1 − t0) from a 64-bit unsigned numerator over a signed 32-bit denominator, rounded to a float. Only the track's last key gives fraction 0; at a range's last key the pair runs into the next range's first key.

The derivation is in the doc.

Callers 4

Callees 0

None by a direct call or jump.

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