Skip to content

Commit

Permalink
fix: vr sessions with unbounded
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Aug 1, 2024
1 parent b92123a commit dee27cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/xr/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export type XRSessionInitOptions = {
}

export function buildXRSessionInit(
mode: XRSessionMode,
domOverlayRoot: Element,
{
anchors = true,
Expand Down Expand Up @@ -84,7 +85,9 @@ export function buildXRSessionInit(
addXRSessionFeature(depthSensing, 'depth-sensing', requiredFeatures, optionalFeatures)
addXRSessionFeature(domOverlay, 'dom-overlay', requiredFeatures, optionalFeatures)
addXRSessionFeature(hitTest, 'hit-test', requiredFeatures, optionalFeatures)
addXRSessionFeature(unbounded, 'unbounded', requiredFeatures, optionalFeatures)
if (mode != 'immersive-vr') {
addXRSessionFeature(unbounded, 'unbounded', requiredFeatures, optionalFeatures)
}

return {
requiredFeatures,
Expand Down
2 changes: 1 addition & 1 deletion packages/xr/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ async function enterXR(
if (xrManager == null) {
return Promise.reject(new Error(`not connected to three.js. Missing are <XR> component?`))
}
const session = await navigator.xr.requestSession(mode, buildXRSessionInit(domOverlayRoot, options))
const session = await navigator.xr.requestSession(mode, buildXRSessionInit(mode, domOverlayRoot, options))
setFrameRate(session, options?.frameRate ?? 'high')
setupXRManager(xrManager, session, options)
return session
Expand Down

0 comments on commit dee27cc

Please sign in to comment.