Browse Source

ViveController: pose.position/orientation may be null.

Mr.doob 9 years ago
parent
commit
a17c4c5ea0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/js/ViveController.js

+ 2 - 2
examples/js/ViveController.js

@@ -67,8 +67,8 @@ THREE.ViveController = function ( id ) {
 
 			var pose = gamepad.pose;
 
-			scope.position.fromArray( pose.position );
-			scope.quaternion.fromArray( pose.orientation );
+			if ( pose.position !== null ) scope.position.fromArray( pose.position );
+			if ( pose.orientation !== null ) scope.quaternion.fromArray( pose.orientation );
 			scope.matrix.compose( scope.position, scope.quaternion, scope.scale );
 			scope.matrix.multiplyMatrices( scope.standingMatrix, scope.matrix );
 			scope.matrixWorldNeedsUpdate = true;