benilla-re systems structs docs

Sound::SetCutoffDistanceSquared

function · sound · primitive

Address
0x7a5ca0 · 196 bytes, up to 0x7a5d63
Meaning
Stores a 3D sound's cutoff distance and joins or leaves the cutoff list
Confidence
verified, proof one
Name from
the community database (idb)
Finding
sound/engine#distance-cutoff
Test
sound::max_distance_cull

Finding: Distance cutoff in sound: the engine

Sound::SetCutoffDistanceSquared(c) stores the distance c (not its square) for a 3D sound: 0 removes the sound from the cutoff list; otherwise it joins it, and a looped sound at or beyond c of the listener, or at a NaN distance, is paused under reason 3 and flagged cut off. Each frame, a listed sound strictly beyond c is skipped if cut off, suspended if looped, left playing if flagged 0x4, and released otherwise. In range its distance gain is 1 − min(max(d − 0.9c, 0), k) / k with k = c · 0.10000002: recomputed every frame between 0.9c and c, and once on entering 0.9c, which leaving re-arms. A cut-off sound coming back resumes, restarting its stream.

The derivation is in the doc.

Callers 1

Callees 4

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