benilla-re systems structs docs

LightningBolt::BuildPoints

function · gx · primitive

Address
0x7af6d0 · 701 bytes, up to 0x7af98c
Signature
void __thiscall (LightningBolt *this, void *points)
Meaning
Fills an array with the bolt's centre line: start, jittered interior points and end
Confidence
verified, proof one
Finding
gx/lightning#bolt-shape
Test
gx::lightning_segment_subdivide_difftest

Finding: Bolt shape in gx: lightning

0x7af6d0(points) fills points with the bolt's centre line. With d = end - start, n = ftol(|d| / segment + 2.0) and s = |d| * jitter ([bolt+0x24]), it makes n + 1 points: the first is start, the last is end, and point i from 1 to n - 1 is (start + (d * i) * (1 / n)) + (r1, r2, r3) * s, each r drawn from 0x4531e0 on the file's generator: the low 23 bits of the draw ORed into 0x3f800000 give a float in [1, 2), which becomes f - 2.0 when the draw is non-negative and 2.0 - f when it is negative. Every bolt shares the generator, which starts from seed 0.

The derivation is in the doc.

Callers 1

Callees 7

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