소스 검색

Update windowsMotionController.ts

Since the motion controller is the default controller it leads to  problems when used with other generic controllers like the mozilla xr emulator. 

Make sure the mesh info exists before checking other variables
Raanan Weber 5 년 전
부모
커밋
c4d9825e05
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Gamepads/Controllers/windowsMotionController.ts

+ 1 - 1
src/Gamepads/Controllers/windowsMotionController.ts

@@ -269,7 +269,7 @@ export class WindowsMotionController extends WebVRController {
 
         var meshInfo = this._loadedMeshInfo.buttonMeshes[buttonName];
 
-        if (!meshInfo.unpressed.rotationQuaternion || !meshInfo.pressed.rotationQuaternion || !meshInfo.value.rotationQuaternion) {
+        if (!meshInfo || !meshInfo.unpressed.rotationQuaternion || !meshInfo.pressed.rotationQuaternion || !meshInfo.value.rotationQuaternion) {
             return;
         }