提交 f9630d64 编写于 作者: M Mr.doob

Updated builds

上级 db5bfed9
......@@ -22763,7 +22763,7 @@
var gamepads = navigator.getGamepads && navigator.getGamepads();
for ( var i = 0, j = 0, l = gamepads.length; i < l; i ++ ) {
for ( var i = 0, l = gamepads.length; i < l; i ++ ) {
var gamepad = gamepads[ i ];
......@@ -22773,9 +22773,10 @@
gamepad.id.startsWith( 'HTC Vive Focus' ) ||
gamepad.id.startsWith( 'Spatial Controller' ) ) ) {
if ( j === id ) { return gamepad; }
var hand = gamepad.hand;
j ++;
if ( id === 0 && ( hand === '' || hand === 'right' ) ) { return gamepad; }
if ( id === 1 && ( hand === 'left' ) ) { return gamepad; }
}
......@@ -23096,7 +23097,7 @@
var pose = null;
var controllers = [];
var inputSources = [];
var sortedInputSources = [];
function isPresenting() {
......@@ -23146,7 +23147,7 @@
for ( var i = 0; i < controllers.length; i ++ ) {
if ( inputSources[ i ] === event.inputSource ) {
if ( sortedInputSources[ i ] === event.inputSource ) {
controllers[ i ].dispatchEvent( { type: event.type } );
......@@ -23213,25 +23214,41 @@
//
inputSources = session.inputSources;
session.addEventListener( 'inputsourceschange', updateInputSources );
session.addEventListener( 'inputsourceschange', function () {
updateInputSources();
inputSources = session.inputSources;
console.log( inputSources );
}
for ( var i = 0; i < controllers.length; i ++ ) {
};
var controller = controllers[ i ];
controller.userData.inputSource = inputSources[ i ];
function updateInputSources() {
}
for ( var i = 0; i < controllers.length; i ++ ) {
} );
sortedInputSources[ i ] = findInputSource( i );
}
};
}
function findInputSource( id ) {
var inputSources = session.inputSources;
for ( var i = 0; i < inputSources.length; i ++ ) {
var inputSource = inputSources[ i ];
var handedness = inputSource.handedness;
if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) { return inputSource; }
if ( id === 1 && ( handedness === 'left' ) ) { return inputSource; }
}
}
//
function updateCamera( camera, parent ) {
......@@ -23330,7 +23347,7 @@
var controller = controllers[ i ];
var inputSource = inputSources[ i ];
var inputSource = sortedInputSources[ i ];
if ( inputSource ) {
此差异已折叠。
......@@ -22750,7 +22750,7 @@ function WebVRManager( renderer ) {
var gamepads = navigator.getGamepads && navigator.getGamepads();
for ( var i = 0, j = 0, l = gamepads.length; i < l; i ++ ) {
for ( var i = 0, l = gamepads.length; i < l; i ++ ) {
var gamepad = gamepads[ i ];
......@@ -22760,9 +22760,10 @@ function WebVRManager( renderer ) {
gamepad.id.startsWith( 'HTC Vive Focus' ) ||
gamepad.id.startsWith( 'Spatial Controller' ) ) ) {
if ( j === id ) return gamepad;
var hand = gamepad.hand;
j ++;
if ( id === 0 && ( hand === '' || hand === 'right' ) ) return gamepad;
if ( id === 1 && ( hand === 'left' ) ) return gamepad;
}
......@@ -23083,7 +23084,7 @@ function WebXRManager( renderer, gl ) {
var pose = null;
var controllers = [];
var inputSources = [];
var sortedInputSources = [];
function isPresenting() {
......@@ -23133,7 +23134,7 @@ function WebXRManager( renderer, gl ) {
for ( var i = 0; i < controllers.length; i ++ ) {
if ( inputSources[ i ] === event.inputSource ) {
if ( sortedInputSources[ i ] === event.inputSource ) {
controllers[ i ].dispatchEvent( { type: event.type } );
......@@ -23200,25 +23201,41 @@ function WebXRManager( renderer, gl ) {
//
inputSources = session.inputSources;
session.addEventListener( 'inputsourceschange', updateInputSources );
session.addEventListener( 'inputsourceschange', function () {
updateInputSources();
inputSources = session.inputSources;
console.log( inputSources );
}
for ( var i = 0; i < controllers.length; i ++ ) {
};
var controller = controllers[ i ];
controller.userData.inputSource = inputSources[ i ];
function updateInputSources() {
}
for ( var i = 0; i < controllers.length; i ++ ) {
} );
sortedInputSources[ i ] = findInputSource( i );
}
};
}
function findInputSource( id ) {
var inputSources = session.inputSources;
for ( var i = 0; i < inputSources.length; i ++ ) {
var inputSource = inputSources[ i ];
var handedness = inputSource.handedness;
if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
}
}
//
function updateCamera( camera, parent ) {
......@@ -23317,7 +23334,7 @@ function WebXRManager( renderer, gl ) {
var controller = controllers[ i ];
var inputSource = inputSources[ i ];
var inputSource = sortedInputSources[ i ];
if ( inputSource ) {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册