From 1578a2f5e8b5b49e9ffbf0bdbd8bf02abdde01bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20Rodi=C4=87?= Date: Thu, 22 Apr 2021 01:48:52 -0700 Subject: [PATCH] Added "controllermove" event to WebXRController (#20790) Co-authored-by: Aki Rodic --- src/renderers/webxr/WebXRController.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderers/webxr/WebXRController.js b/src/renderers/webxr/WebXRController.js index 1d53a6dc9f..34f2650688 100644 --- a/src/renderers/webxr/WebXRController.js +++ b/src/renderers/webxr/WebXRController.js @@ -218,18 +218,24 @@ class WebXRController { targetRay.visible = ( inputPose !== null ); + if ( targetRay.visible ) targetRay.dispatchEvent( { type: 'controllermove' } ); + } if ( grip !== null ) { grip.visible = ( gripPose !== null ); + if ( grip.visible ) grip.dispatchEvent( { type: 'controllermove' } ); + } if ( hand !== null ) { hand.visible = ( handPose !== null ); + if ( hand.visible ) hand.dispatchEvent( { type: 'controllermove' } ); + } return this; -- GitLab