benilla-re systems structs docs

CCamera::ClipNearBox

function · uicamera · primitive

Address
0x50de90 · 1685 bytes, up to 0x50e524
Signature
bool __thiscall (CCamera *this, float *distance, const NTempest::C3Vector *trialEye, uint32_t flags)
Meaning
Shortens the orbit distance so the near end of the view volume clears the world
Confidence
inferred
Finding
uicamera/solver#the-near-box-clip
Test
ui::cam_50de90, ui::cam_50e570

Finding: The near box clip in uicamera: the near and far solver and the water bands

0x50de90(&distance, trialEye, flags) shortens the orbit distance so the near end of the view volume clears geometry. When the distance is below the near clip plus 0.001 it sets the distance to 0 and answers 1; a distance far under the near clip takes the same exit. Otherwise it builds the view and the projection for the trial eye, takes the eight corners of the volume between the near plane and the trial distance, collects the world polygons that overlap that box and, for the polygons that clip it, finds the largest depth along the box. It reduces the distance by that depth times the distance beyond the near clip, never below 0, and answers 1 when any polygon clipped.

The derivation is in the doc.

Callers 1

Callees 17

Calls and jumps by a bare address, from tables/calls.tsv.