benilla-re systems structs docs

NormalizeVector2InPlace

function · objectlayer · primitive

Address
0x5f8cb0 · 60 bytes, up to 0x5f8ceb
Meaning
Normalises a 2D vector in place, leaving one shorter than 2^-22
Confidence
verified, proof two
Finding
objectlayer/transports#moving-the-ship
Test
objectlayer::diff_normalize_vec2

Finding: Moving the ship in objectlayer: transports

Each tick takes t = (now + +0x278) mod the period (1 when 0) and the first leg ending after t. Within a stop's wait the ship sits at the stop, animation 0; past it the span starts there. Else the speed curve gives the distance into the span, T and t in seconds. The fraction of the leg, clamped to [0, 1] with NaN as 1, gives the spline frame. The heading is the frame's tangent with x and y negated and normalised, and the facing its atan2: the ship faces against its tangent. A leg on another map ends the tick. Else the position, facing and entity move, and a changed animation plays once the entity is ready.

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.