benilla-re systems structs docs

s_clipKeepBand

global · collision

Address
0x80dff0 · 4 bytes, up to 0x80dff3
Type
float
Meaning
Holds -1/720 (0xbab60b61); a polygon with no vertex at or below it is kept whole by the clip
Confidence
verified, proof one
Finding
collision/contact#polygon-clip

Finding: Polygon clip in collision: contact

A polygon holds up to 15 vertices (12 bytes each from +0x00), a tag per vertex (+0xb4) and a count (+0xf0). 0x6318c0(plane, poly, tag) takes s = −(n·v + d) per vertex, rounded to float. With no vertex, or every s above −1/720, the polygon is unchanged; else with every s below 1/720 it is emptied; a NaN s takes part in neither test. Otherwise each edge (prev, cur), from (last, first), is clipped with s ≥ 0 or NaN inside:

prevcuremits
inincur
outinthe crossing when s_cur > 1/720, then cur
inoutthe crossing when s_prev > 1/720
outoutnothing

A crossing takes the tag. Fewer than three vertices empty the polygon. 0x631870(planes, n, poly) clips by planes 0 to n − 1 with tag i, returning 0 once empty and 1 otherwise; 0x632980 skips one index.

The derivation is in the doc.