Skip to content

Commit 52fa876

Browse files
committed
Document the actual derivation of the push grid query inflation
1 parent 8441526 commit 52fa876

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Quake/sv_phys.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ static int PushGrid_GatherCandidates (const vec3_t mins, const vec3_t maxs, edic
215215
if (!push_grid_valid)
216216
return -1;
217217

218-
// riders sit exactly on top of the pusher without overlapping it, so the
219-
// query box is inflated a little (the +2 on top matters, the rest covers
220-
// the epsilon expansion of absboxes in SV_LinkEdict)
218+
// strictly overlapping absboxes always share a cell, and riders touching the
219+
// pusher overlap it through the +-1 absbox expansion in SV_LinkEdict, so no
220+
// inflation is needed in theory. The +2 is a safety margin for riders whose
221+
// ONGROUND/groundentity state outlives actual contact by a small gap (the
222+
// elevator DIST_EPSILON nudge, float drift); it almost never adds a cell.
221223
int lo[3], hi[3];
222224
PushGrid_CellRange (mins, maxs, 2.0f, lo, hi);
223225

0 commit comments

Comments
 (0)