1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

fix intersectRecursive

This commit is contained in:
Kevin Levron 2021-05-05 21:46:02 +02:00
parent f3ffea6248
commit 8dd9d24f24
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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 {