s_batchIndexCursor
global · terrain
- Address
0xc7b378· 4 bytes, up to0xc7b37b- Type
uint32_t- Meaning
- Holds the next free slot of the batch index pool
- Confidence
- verified, proof one
- Finding
- terrain/collide#triangle-batches
Finding: Triangle batches in terrain: collide
The liquid and map object queries record the triangles they hit as batches in one shared table, and
0x671cc0 turns them into facets. A batch header is 0x20 bytes at
0xc62550 (at most 31 per query, the count at 0xc5a474): +0x0 the matrix, +0x4 the vertex
array (12-byte vertices), +0xc the index triples (16 bits), +0x14 the index count, +0x16
the triangle count, +0x18 and +0x1a the lowest and highest index. The map object
trace keeps the face words of its hit at the first header's +0x10. Matrices are 0x40 bytes at
0xc62980 (31), indices come from a pool of 0xc000 at 0xc63298; a full table sets bit 0 of
0xc63258 and the batch is dropped.
The derivation is in the doc.