Skip to content

Commit 675a109

Browse files
Jo-Byrfinetjul
authored andcommitted
chore(InteractorStyeHDMXR): fix example
Replace failing esm.sh link Remove calls to non-existant functions
1 parent 20663df commit 675a109

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

  • Sources/Interaction/Style/InteractorStyleHMDXR/example

Sources/Interaction/Style/InteractorStyleHMDXR/example/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ import GUI from 'lil-gui';
2929
// Dynamically load WebXR polyfill from CDN for WebVR and Cardboard API backwards compatibility
3030
if (navigator.xr === undefined) {
3131
vtkResourceLoader
32-
.loadScript('https://esm.sh/webxr-polyfill@latest/build/webxr-polyfill.js')
32+
.loadScript(
33+
'https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js'
34+
)
3335
.then(() => {
3436
// eslint-disable-next-line no-new, no-undef
3537
new WebXRPolyfill();
@@ -105,7 +107,7 @@ const gui = new GUI();
105107
let button;
106108
const params = {
107109
toggleVR: () => {
108-
if (!XRHelper.isXRSessionActive()) {
110+
if (XRHelper.getXrSession() === null) {
109111
XRHelper.startXR(XrSessionTypes.HmdVR);
110112
button.name('Exit VR');
111113
} else {
@@ -117,9 +119,6 @@ const params = {
117119

118120
button = gui.add(params, 'toggleVR').name('Start VR');
119121

120-
XRHelper.onSessionStarted(() => button.name('Exit VR'));
121-
XRHelper.onSessionEnded(() => button.name('Start VR'));
122-
123122
// -----------------------------------------------------------
124123
// Make some variables global so that you can inspect and
125124
// modify objects in your browser's developer console:

0 commit comments

Comments
 (0)