فهرست منبع

Added "controllermove" event to WebXRController (#20790)

Co-authored-by: Aki Rodic <[email protected]>
Aki Rodić 4 سال پیش
والد
کامیت
1578a2f5e8
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/renderers/webxr/WebXRController.js

+ 6 - 0
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;