From 6101fbebfbfdde81494870454e83cc1811724981 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Mon, 26 Feb 2024 08:45:32 -0500 Subject: [PATCH] Raycaster: Added setFromXRController() --- types/three/src/core/Raycaster.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/three/src/core/Raycaster.d.ts b/types/three/src/core/Raycaster.d.ts index 6cd6d5145..f3c4d44a0 100644 --- a/types/three/src/core/Raycaster.d.ts +++ b/types/three/src/core/Raycaster.d.ts @@ -2,6 +2,7 @@ import { Camera } from "../cameras/Camera.js"; import { Ray } from "../math/Ray.js"; import { Vector2 } from "../math/Vector2.js"; import { Vector3 } from "../math/Vector3.js"; +import { XRTargetRaySpace } from "../renderers/webxr/WebXRController.js"; import { Layers } from "./Layers.js"; import { Object3D } from "./Object3D.js"; @@ -155,6 +156,12 @@ export class Raycaster { */ setFromCamera(coords: Vector2, camera: Camera): void; + /** + * Updates the ray with a new origin and direction. + * @param controller The controller to copy the position and direction from. + */ + setFromXRController(controller: XRTargetRaySpace): this; + /** * Checks all intersection between the ray and the object with or without the descendants * @remarks Intersections are returned sorted by distance, closest first