Skip to content

Commit

Permalink
Merge pull request #16425 from j-devel/fix-webvr-spurious-events
Browse files Browse the repository at this point in the history
WebVRManager: Fix spurious events on the first update of the VR controllers.
  • Loading branch information
mrdoob committed May 14, 2019
2 parents ed66e62 + 9b062a5 commit 35bd7a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/renderers/webvr/WebVRManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function WebVRManager( renderer ) {

var buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1;

if ( triggers[ i ] === undefined ) triggers[ i ] = false;

if ( triggers[ i ] !== gamepad.buttons[ buttonId ].pressed ) {

triggers[ i ] = gamepad.buttons[ buttonId ].pressed;
Expand Down

0 comments on commit 35bd7a8

Please sign in to comment.