SetConvexVolume
function · terrain · orchestration
- Address
0x6865f0· 67 bytes, up to0x686632- Signature
void __thiscall (void *this, uint32_t arg2)- Meaning
- Copies eight corners and builds the volume's planes
- Confidence
- inferred
- Finding
- terrain/scene#portal-volumes
Finding: Portal volumes in terrain: scene
A volume is six planes, 16 bytes each (n, d), then eight corners from +0x60, 12 bytes apart. The corners
are in the frustum corner order: c0 to c3 on the near plane (bottom-left, top-left, top-right, bottom-right) and
c4 to c7 the same on the far plane. 0x682930 makes the eight corners of a portal window from the frustum
rays: two passes of four corners, each narrowed to the window's rectangle. It hands them to 0x6865f0, which
copies them to the volume at the top of the frustum stack and builds the planes with 0x686640, then sorts a local
copy of the corners that nothing reads.
| plane | side | normal | d = −n·anchor |
|---|---|---|---|
| 0 | top | (c5 − c1) × (c6 − c1) | c1 |
| 1 | bottom | (c7 − c0) × (c4 − c0) | c0 |
| 2 | left | (c4 − c0) × (c5 − c0) | c0 |
| 3 | right | (c6 − c3) × (c7 − c3) | c3 |
| 4 | far | (c4 − c5) × (c6 − c5) | c5 |
| 5 | near | −(plane 4 normal) | c2 |
The derivation is in the doc.
Callers 3
- BuildFrustumVolume terrain
- SetFrustumVolume terrain
- BuildPortalVolume terrain
Callees 1
- BuildConvexPlanes terrain
Calls and jumps by a bare address, from tables/calls.tsv.