benilla-re systems structs docs

UnitFacingToVector

function · ui · primitive

Address
0x483430 · 32 bytes, up to 0x48344f
Signature
float * __fastcall (float *out, CGObject *unit)
Meaning
Writes the unit's facing as a unit vector (cos, sin, 0) and returns the buffer
Confidence
verified, proof one
Finding
sound/listener#the-listener-follows-the-mover
Test
ui::textglue_482_cos_sin

Finding: The listener follows the mover in sound: where the listener stands

Each frame 0x482ea0 places the listener at the unit the client drives: the active mover, resolved from the GUID 0xc4da98, 0xc4da9c with type mask 8, else the active player (mask 0x10). The position is the unit's position with its height raised by the product of its +0x90 and +0xbc. The forward vector is the cosine and sine of the unit's facing with z 0, the up vector is (0, 0, 1) and the velocity is null. The update is skipped when neither unit resolves. The SoundListenerAtCharacter variable at 0xb4b2b4 being 0 (0x48311f), or a shot camera being armed, sends the update to the camera branch instead.

The derivation is in the doc.

Callers 1

Callees 0

None by a direct call or jump.

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