TracePick
function · ui · primitive
- Address
0x480df0· 600 bytes, up to0x481047- Meaning
- Traces the terrain and the candidate objects and returns the nearer hit as a pick state
- Confidence
- verified, proof one
- Finding
- ui/worldpick#what-the-pick-returns
- Test
ui::glue_geom_480_480a50_480df0_dist_scale,ui::glue_geom_480_480df0_normalize
Finding: What the pick returns in ui: the world pick
0x481190(cursor position, out) returns 0 at once when the flag word is 0. Otherwise it stores the ray's origin at out+0x18 and far point at out+0x24 on every call, and calls 0x480df0. That traces the terrain segment (0x672170; collision mask 0x1000114, or 0x10f0114 with flag 0x2) and, only when the flag word has any of the bits 0x7c, the object candidates (0x480a50). The nearer wins; a tie or an unordered compare goes to the object.
An object hit returns 2 with its GUID at out+0 and its point and distance; a terrain hit returns flag bit 0 as the state (1 or 0); no hit returns 0.
The derivation is in the doc.
Callers 1
- PickAtCursor ui
Callees 5
- SetVector3 spline
- Vector3LengthSquared spline
- RayHitPickCandidates ui
- AddVector3InPlace ui
- TraceWorldSegment terrain
Calls and jumps by a bare address, from tables/calls.tsv.