Skip to content

Commit

Permalink
Raycaster: Added setFromXRController() (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Feb 26, 2024
1 parent 4aef24d commit f13203f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/three/src/core/Raycaster.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f13203f

Please sign in to comment.