From 8dd9d24f24cc0e4d57cd7aa25217b10efc7e24b2 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Wed, 5 May 2021 21:46:02 +0200 Subject: [PATCH] fix intersectRecursive --- src/core/usePointer.ts | 2 +- src/core/useRaycaster.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/usePointer.ts b/src/core/usePointer.ts index 1938cdf..b324f89 100644 --- a/src/core/usePointer.ts +++ b/src/core/usePointer.ts @@ -181,7 +181,7 @@ export default function usePointer(options: PointerConfigInterface): PointerInte function pointerClick(event: TouchEvent | MouseEvent) { updatePosition(event) if (intersectObjects.length) { - const intersects = raycaster.intersect(positionN, intersectObjects) + const intersects = raycaster.intersect(positionN, intersectObjects, intersectRecursive) const iMeshes: InstancedMesh[] = [] intersects.forEach(intersect => { const { object } = intersect diff --git a/src/core/useRaycaster.ts b/src/core/useRaycaster.ts index 2ebf662..823bd6f 100644 --- a/src/core/useRaycaster.ts +++ b/src/core/useRaycaster.ts @@ -4,7 +4,7 @@ import { IntersectObject } from './usePointer' export interface RaycasterInterface { position: Vector3 updatePosition(coords: Vector2): void - intersect(coords: Vector2, objects: IntersectObject[], recursive: boolean): Intersection[], + intersect(coords: Vector2, objects: IntersectObject[], recursive?: boolean): Intersection[], } export interface RaycasterConfigInterface {