浏览代码

WebXRController: Loose checks to avoid breaking WebXR Emulator.

Mr.doob 4 年之前
父节点
当前提交
b82d7bd874
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/renderers/webxr/WebXRController.js

+ 4 - 4
src/renderers/webxr/WebXRController.js

@@ -137,7 +137,7 @@ class WebXRController {
 					targetRay.matrix.fromArray( inputPose.transform.matrix );
 					targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
 
-					if ( inputPose.linearVelocity !== null ) {
+					if ( inputPose.linearVelocity ) {
 
 						targetRay.hasLinearVelocity = true;
 						targetRay.linearVelocity.copy( inputPose.linearVelocity );
@@ -148,7 +148,7 @@ class WebXRController {
 
 					}
 
-					if ( inputPose.angularVelocity !== null ) {
+					if ( inputPose.angularVelocity ) {
 
 						targetRay.hasAngularVelocity = true;
 						targetRay.angularVelocity.copy( inputPose.angularVelocity );
@@ -241,7 +241,7 @@ class WebXRController {
 						grip.matrix.fromArray( gripPose.transform.matrix );
 						grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
 
-						if ( gripPose.linearVelocity !== null ) {
+						if ( gripPose.linearVelocity ) {
 
 							grip.hasLinearVelocity = true;
 							grip.linearVelocity.copy( gripPose.linearVelocity );
@@ -252,7 +252,7 @@ class WebXRController {
 
 						}
 
-						if ( gripPose.angularVelocity !== null ) {
+						if ( gripPose.angularVelocity ) {
 
 							grip.hasAngularVelocity = true;
 							grip.angularVelocity.copy( gripPose.angularVelocity );