Skip to content

Commit

Permalink
WebXRController: Loose checks to avoid breaking WebXR Emulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 22, 2021
1 parent 907fb0a commit b82d7bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderers/webxr/WebXRController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -148,7 +148,7 @@ class WebXRController {

}

if ( inputPose.angularVelocity !== null ) {
if ( inputPose.angularVelocity ) {

targetRay.hasAngularVelocity = true;
targetRay.angularVelocity.copy( inputPose.angularVelocity );
Expand Down Expand Up @@ -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 );
Expand All @@ -252,7 +252,7 @@ class WebXRController {

}

if ( gripPose.angularVelocity !== null ) {
if ( gripPose.angularVelocity ) {

grip.hasAngularVelocity = true;
grip.angularVelocity.copy( gripPose.angularVelocity );
Expand Down

0 comments on commit b82d7bd

Please sign in to comment.