Skip to content

Commit 080d7ff

Browse files
authored
Merge pull request #236 from cabanier/tracked-sources
Make tracked-sources optional
2 parents 9f31b9f + 91d86d0 commit 080d7ff

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

immersive-hands.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
of cubes. Each cube represents a joint in your hand.
4444
<a class="back" href="./">Back</a>
4545
</p>
46+
<label><input type='checkbox' id='trackedSources' checked> Request tracked-sources</label>
4647
</details>
4748
</header>
4849
<main style='text-align: center;'>
@@ -185,7 +186,11 @@
185186
// Called when the user selects a device to present to. In response we
186187
// will request an exclusive session from that device.
187188
function onRequestSession() {
188-
return navigator.xr.requestSession(isAR?'immersive-ar':'immersive-vr', { optionalFeatures: ['local-floor', 'bounded-floor', 'hand-tracking'] }).then(onSessionStarted);
189+
let optionalFeatures = ['local-floor', 'bounded-floor', 'hand-tracking'];
190+
if (document.getElementById('trackedSources').checked) {
191+
optionalFeatures.push('tracked-sources');
192+
}
193+
return navigator.xr.requestSession(isAR?'immersive-ar':'immersive-vr', { optionalFeatures }).then(onSessionStarted);
189194
}
190195

191196
// Called when we've successfully acquired a XRSession. In response we

0 commit comments

Comments
 (0)