Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / intersectScene

Function: intersectScene() ​

ts
function intersectScene(
   raycaster, 
   roots, 
   query?): Intersection<Object3D<Object3DEventMap>>[];

Defined in: utils/raycast.ts:193

Intersect roots (recursively). With firstHitOnly, meshes are visited nearest bounding sphere first and the search stops once the next sphere starts beyond the best hit, so a ray through a city tests the few buildings in front instead of all of them.

Parameters ​

ParameterType
raycasterRaycaster
rootsreadonly Object3D<Object3DEventMap>[]
queryRaycastQuery

Returns ​

Intersection<Object3D<Object3DEventMap>>[]