Function: raycastBodies()
ts
function raycastBodies(
raycaster,
bodies,
options?): RaycastHit | null;Raycasts against all body groups and returns the first valid hit.
Filtering rules:
- Hits beyond the body's radius are discarded (avoids mesh-edge false hits).
- When a focused body is provided, it is skipped as a candidate and used as an occluder sphere — hits behind it are discarded.
Parameters
| Parameter | Type |
|---|---|
raycaster | Raycaster |
bodies | RaycastBody[] |
options? | RaycastBodiesOptions |
Returns
RaycastHit | null