flywave-3dtile-datasource.raycasttraversefirsthit
Home > @flywave/flywave-3dtile-datasource > raycastTraverseFirstHit
raycastTraverseFirstHit() function
Finds the closest hit when traversing the tile hierarchy
This function performs hierarchical raycasting against the tile hierarchy, finding the closest intersection by traversing bounding volumes and testing actual scene content only when necessary.
Signature:
export declare function raycastTraverseFirstHit(renderer: TilesRenderer, tile: ITile, raycaster: Raycaster, localRay?: Ray | null): TileIntersection | null;
Parameters
Parameter | Type | Description |
|---|---|---|
renderer | TilesRenderer | The tiles renderer instance |
tile | The root tile to start traversal from | |
raycaster | Raycaster | The raycaster to use |
localRay | Ray | null | (Optional) Pre-calculated local ray (optional) |
Returns:
[TileIntersection](./flywave-3dtile-datasource.tileintersection.md) \| null
The closest intersection or null if none found