File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 255
255
256
256
XRManager . prototype . getXRGamepads = function ( frame , inputSources , refSpace ) {
257
257
var vrGamepads = [ ]
258
- for ( let inputSource of inputSources ) {
258
+ if ( ! inputSources || ! inputSources . length ) {
259
+ return vrGamepads ;
260
+ }
261
+ for ( var i = 0 ; i < inputSources . length ; i ++ ) {
262
+ let inputSource = inputSources [ i ] ;
259
263
// Show the input source if it has a grip space
260
264
if ( inputSource . gripSpace && inputSource . gamepad ) {
261
265
let inputPose = frame . getPose ( inputSource . gripSpace , refSpace ) ;
Original file line number Diff line number Diff line change 255
255
256
256
XRManager . prototype . getXRGamepads = function ( frame , inputSources , refSpace ) {
257
257
var vrGamepads = [ ]
258
- for ( let inputSource of inputSources ) {
258
+ if ( ! inputSources || ! inputSources . length ) {
259
+ return vrGamepads ;
260
+ }
261
+ for ( var i = 0 ; i < inputSources . length ; i ++ ) {
262
+ let inputSource = inputSources [ i ] ;
259
263
// Show the input source if it has a grip space
260
264
if ( inputSource . gripSpace && inputSource . gamepad ) {
261
265
let inputPose = frame . getPose ( inputSource . gripSpace , refSpace ) ;
Original file line number Diff line number Diff line change 255
255
256
256
XRManager . prototype . getXRGamepads = function ( frame , inputSources , refSpace ) {
257
257
var vrGamepads = [ ]
258
- for ( let inputSource of inputSources ) {
258
+ if ( ! inputSources || ! inputSources . length ) {
259
+ return vrGamepads ;
260
+ }
261
+ for ( var i = 0 ; i < inputSources . length ; i ++ ) {
262
+ let inputSource = inputSources [ i ] ;
259
263
// Show the input source if it has a grip space
260
264
if ( inputSource . gripSpace && inputSource . gamepad ) {
261
265
let inputPose = frame . getPose ( inputSource . gripSpace , refSpace ) ;
You can’t perform that action at this time.
0 commit comments