Browse Source

WebXRManager: Only display controller when targetRayMode is pointing.

Mr.doob 5 years ago
parent
commit
7aba69b75a
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/renderers/webxr/WebXRManager.js

+ 6 - 1
src/renderers/webxr/WebXRManager.js

@@ -352,7 +352,12 @@ function WebXRManager( renderer, gl ) {
 
 					controller.matrix.fromArray( inputPose.transform.matrix );
 					controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
-					controller.visible = true;
+
+					if ( inputSource.targetRayMode === 'pointing' ) {
+
+						controller.visible = true;
+
+					}
 
 					continue;