# Intersections
Entry point for intersecting and obtaining intersection data from the scene. Accessible from SpeckleRenderer
# Methods
intersect | intersectRay |
---|
# Methods
# intersect
intersect(
scene: Scene,
camera: Camera,
point: Vector2,
nearest = true,
bounds: Box3 = null,
castLayers: Array<ObjectLayers> = undefined,
firstOnly = false
): Array<Intersection>
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Scene intersect function.
TIP
All intersect calls from this class will use the available acceleration structures. This makes the intersection significantly faster than using your own three.js raycasters.
Parameters
- scene: Scene (opens new window)
- camera: Camera (opens new window)
- point: The NDC point to cast the ray from
- nearest: If the results should be sorted by dinstance. i.e nearest first
- bounds: An optional bounds where the intersecting takes place. Everything outside this bounds is disregarded from the result list
- castLayers: The ObjectLayers enabled on the raycaster for this cast. Any object outside of these layers is disregarded from intersection
- firstOnly: When this flag is enabled the acceleration structure will stop traversing after encountering the first intersection. Only applies to meshes
Returns: Array< Intersection > Three.js defined intersection
# intersectRay
intersectRay(
scene: Scene,
camera: Camera,
ray: Ray,
nearest = true,
bounds: Box3 = null,
castLayers: Array<ObjectLayers> = undefined,
firstOnly = false
): Array<Intersection>
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Scene intersect function using a provided Ray.
TIP
All intersect calls from this class will use the available acceleration structures. This makes the intersection significantly faster than using your own three.js raycasters.
Parameters
- scene: Scene (opens new window)
- camera: Camera (opens new window)
- ray: The ray to use for casting
- nearest: If the results should be sorted by dinstance. i.e nearest first
- bounds: An optional bounds where the intersecting takes place. Everything outside this bounds is disregarded from the result list
- castLayers: The ObjectLayers enabled on the raycaster for this cast. Any object outside of these layers is disregarded from intersection
- firstOnly: When this flag is enabled the acceleration structure will stop traversing after encountering the first intersection. Only applies to meshes
Returns: Array< Intersection > Three.js defined intersection