benilla-re systems structs docs

M2SceneSegmentCollision

function · models · primitive

Address
0x7099e0 · 1650 bytes, up to 0x70a051
Signature
uint32_t __thiscall (M2Scene *this, const NTempest::C3Vector *p0, const NTempest::C3Vector *p1, float *fraction)
Meaning
Finds the nearest collision triangle of the mode 3 hit-test instances on a segment and returns that instance's value
Confidence
verified, proof one
Finding
models/scene#segment-collision
Test
models::half_scale_difftest, models::segment_ray_setup_difftest, models::segment_sphere_difftest, models::segment_sphere_paths_difftest, models::segment_tbest_init_difftest, models::segment_world_distance_difftest, models::tri_invray_difftest, models::tri_t_world_difftest

Finding: Segment collision in models: the scene

0x7099e0(p0, p1, &f) finds the nearest collision triangle of the scene's hit-test instances on the segment within the fraction f, writes the hit's fraction to f and returns the instance's user value +0x41c, else 0. A segment or f under 1e-5 returns 0. Each listed, loaded instance is first a sphere: its current sequence's bounds, or the model's when that radius is 0, through the base matrix; the sphere must meet the line with its near point before the segment end and its far point not behind the start. Candidates sorted by near then far distance are tested while their near distance is under the best hit, and only mode 3 instances test triangles. Every call empties the hit list.

The derivation is in the doc.

Callers 1

Callees 9

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