未验证 提交 f67bc801 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #14575 from mrdoob/webvr

WebVRManager: Fixed broken events with more than one controller.
......@@ -84,7 +84,7 @@ function WebVRManager( renderer ) {
//
var isTriggerPressed = false;
var triggers = [];
function findGamepad( id ) {
......@@ -139,11 +139,11 @@ function WebVRManager( renderer ) {
var buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1;
if ( isTriggerPressed !== gamepad.buttons[ buttonId ].pressed ) {
if ( triggers[ i ] !== gamepad.buttons[ buttonId ].pressed ) {
isTriggerPressed = gamepad.buttons[ buttonId ].pressed;
triggers[ i ] = gamepad.buttons[ buttonId ].pressed;
if ( isTriggerPressed ) {
if ( triggers[ i ] === true ) {
controller.dispatchEvent( { type: 'selectstart' } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册