Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raycaster: Added setFromXRController() #841

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading