Skip to content

Commit 88c9e38

Browse files
author
Avaer Kazmer
committed
Hack
1 parent 24e2724 commit 88c9e38

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ew.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const {_makeNullPromise} = utils;
2020

2121
GlobalContext.args = {};
2222
GlobalContext.version = '';
23+
window.GlobalContext = GlobalContext;
2324

2425
const args = {};
2526
core.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;
467469
core.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

Comments
 (0)