benilla-re systems structs docs

M2SceneRayHit

function · models · primitive

Address
0x7089c0 · 4126 bytes, up to 0x7099dd
Signature
uint32_t __thiscall (M2Scene *this, const float *p0, const float *p1, float *fraction, uint32_t retry)
Meaning
Finds the nearest collision or skinned triangle of the hit-test instances on a segment and returns the instance value
Confidence
verified, proof one
Finding
models/scene#ray-hits
Test
models::aabb_corner_sum_difftest, models::alpha_scale_difftest, models::hit_ray_setup_difftest, models::hit_sphere_difftest, models::hit_sphere_paths_difftest, models::hit_tbest_init_difftest, models::hit_world_distance_difftest, models::mat_x_dir_difftest, models::scale_t_dot_difftest, models::skin_accum_difftest, models::skin_first_difftest, models::tri_predicate_difftest, models::tri_predicate_paths_difftest, models::tworld_recover_difftest

Finding: Ray hits in models: the scene

0x7089c0(p0, p1, &f, retry) finds the nearest triangle of the hit-test instances on the segment within f, writes its fraction and returns the instance's user value, else 0. Candidates are that entry's spheres placed by the world matrix, which an unanimated mode 3 instance without a parent rebuilds; other unanimated instances are skipped. Mode 3 tests the collision triangles. Modes 1 and 2 skin each visible submesh of view 0 on the CPU and test its triangles, skipping units with flag 8, alpha 0 and, for mode 2, blends other than 0. With nothing hit and retry set, a second pass covers the whole segment with fattened meshes, and a higher priority beats a nearer hit.

The derivation is in the doc.

Callers 3

Callees 7

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