@@ -20,6 +20,7 @@ const {_makeNullPromise} = utils;
2020
2121GlobalContext . args = { } ;
2222GlobalContext . version = '' ;
23+ window . GlobalContext = GlobalContext ;
2324
2425const args = { } ;
2526core . setArgs ( args ) ;
@@ -111,7 +112,6 @@ const xrState = (() => {
111112 return result ;
112113 } ) ( ) ,
113114 axes : _makeTypedArray ( Float32Array , 10 ) ,
114- bones : _makeTypedArray ( Float32Array , 31 * 16 ) ,
115115 } ) ;
116116 result . gamepads = ( ( ) => {
117117 const result = Array ( 2 ) ;
@@ -464,8 +464,11 @@ const _tickAnimationFrames = () => {
464464 }
465465 }
466466} ;
467+ window . gamepads = Array ( 2 ) . fill ( null ) ;
468+ window . session = null ;
467469core . animate = ( timestamp , frame , referenceSpace ) => {
468470 const session = core . getSession ( ) ;
471+ window . session = session ;
469472 if ( session ) {
470473 // console.log('animate session', session, frame, referenceSpace);
471474 // debugger;
@@ -490,6 +493,7 @@ core.animate = (timestamp, frame, referenceSpace) => {
490493
491494 let pose , gamepad ;
492495 if ( inputSource && ( pose = frame . getPose ( inputSource . targetRaySpace , referenceSpace ) ) && ( gamepad = inputSource . gamepad || gamepads [ i ] ) ) {
496+ window . gamepads [ i ] = gamepad ;
493497 const { transform} = pose ;
494498 const { position, orientation, matrix} = transform ;
495499 if ( position ) { // new WebXR api
0 commit comments