Skip to content

Commit 85f44aa

Browse files
authored
Merge pull request #14670 from toji/dev
Updated WebXR input to use XRRays when provided by the browser.
2 parents a1bdda4 + 262a8f1 commit 85f44aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/renderers/webvr/WebXRManager.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,16 @@ function WebXRManager( renderer ) {
240240

241241
if ( inputPose !== null ) {
242242

243-
controller.matrix.elements = inputPose.pointerMatrix;
243+
if ('targetRay' in inputPose) {
244+
245+
controller.matrix.elements = inputPose.targetRay.transformMatrix;
246+
247+
} else if ('pointerMatrix' in inputPose) {
248+
249+
controller.matrix.elements = inputPose.pointerMatrix;
250+
251+
}
252+
244253
controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
245254
controller.visible = true;
246255

0 commit comments

Comments
 (0)