benilla-re systems structs docs

s_pickVertexBuffer

global · gxumath

Address
0xc2b970 · 4 bytes, up to 0xc2b973
Type
float *
Meaning
Holds the skinned pick scratch buffer of three floats per vertex
Confidence
verified, proof one
Finding
gxumath#mesh-ray-picks

Finding: Mesh ray picks in gxumath

0x5c5bf0 and 0x5c57a0 return 1 when a ray hits a triangle mesh and store the lowest hit t and its triangle index. The static pick 0x5c5bf0 (ecx origin, edx direction; a count, the vertices, the mode, the index count, the u16 indices and two outputs; ret 0x1c) walks the triangles of mode 3 (list), 4 (strip) or 5 (fan around idx[0]) through 0x5c5560; the skinned pick 0x5c57a0 (ret 0x34) first blends each vertex from up to four bones, then keeps only t ≥ 0. A list of n indices walks (n − 1)/3 + 1 triangles, so a count that is not a multiple of 3 reads past the indices. Indices are not checked against the vertex count.

The derivation is in the doc.