benilla-re systems structs docs

s_lightningScratchPoints

global · gx

Address
0xcf5854 · 12 bytes, up to 0xcf585f
Type
uint32_t[3]
Meaning
Holds the count and array of the scratch centre line each bolt update morphs toward
Confidence
verified, proof one
Finding
gx/lightning#bolt-update

Finding: Bolt update in gx: lightning

0x7af9b0(dt) runs when flag bit 1 is set. With a non-zero period the clock +0x60 becomes fmod(dt + clock, period), otherwise 0. With the rebuild bit set it rebuilds the centre line, sizes the ribbon arrays for 2 * points vertices, writes texture coordinates (the pair at vertex k gets u = k / (2 * points - 2), v 0 and 1; the first two vertices (0, 0.5), the last two (1, 0.5)) and the indices 0, 1, 2, ..., and clears the bit. Every update then builds a second centre line and sets each interior point to 0.75 * old + 0.25 * new.

The derivation is in the doc.