Skip to content

Commit db88c2b

Browse files
committed
WebXRManager: Update controller matrices before dispatching event.
1 parent ab698b3 commit db88c2b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/renderers/webxr/WebXRController.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ class WebXRController {
169169

170170
joint.matrix.fromArray( jointPose.transform.matrix );
171171
joint.matrix.decompose( joint.position, joint.rotation, joint.scale );
172+
joint.matrixWorldNeedsUpdate = true;
172173
joint.jointRadius = jointPose.radius;
173174

174175
}
@@ -217,6 +218,7 @@ class WebXRController {
217218

218219
grip.matrix.fromArray( gripPose.transform.matrix );
219220
grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
221+
grip.matrixWorldNeedsUpdate = true;
220222

221223
if ( gripPose.linearVelocity ) {
222224

@@ -261,6 +263,7 @@ class WebXRController {
261263

262264
targetRay.matrix.fromArray( inputPose.transform.matrix );
263265
targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
266+
targetRay.matrixWorldNeedsUpdate = true;
264267

265268
if ( inputPose.linearVelocity ) {
266269

src/renderers/webxr/WebXRManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class WebXRManager extends EventDispatcher {
130130

131131
if ( controller !== undefined ) {
132132

133+
controller.update( event.inputSource, event.frame, customReferenceSpace || referenceSpace );
133134
controller.dispatchEvent( { type: event.type, data: event.inputSource } );
134135

135136
}

0 commit comments

Comments
 (0)