Skip to content

Commit d87d9cc

Browse files
zjm-metameta-codesync[bot]
authored andcommitted
fix(core): Add unbounded to the XRFeatureOptions to be used in world.create.
Summary: As is called out by the developer in https://fb.workplace.com/groups/1486811539191458/permalink/1541691123703499/ that unbounded is not supported as a part of XRFeatureOptions in world.init. Adding this feature to support unbounded in IWSDK. Reviewed By: felixtrz Differential Revision: D91151030 fbshipit-source-id: 30bbd84829734c537adbbdb847dfe16105b696be
1 parent 419fe9a commit d87d9cc

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

  • examples/scene-understanding/src
  • packages/core/src/init

examples/scene-understanding/src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
FrontSide,
2222
MovementMode,
2323
Vector3,
24+
ReferenceSpaceType,
2425
eq,
2526
} from '@iwsdk/core';
2627

@@ -92,11 +93,13 @@ World.create(document.getElementById('scene-container'), {
9293
undefined,
9394
xr: {
9495
sessionMode: SessionMode.ImmersiveAR,
96+
referenceSpace: ReferenceSpaceType.Unbounded,
9597
features: {
96-
hitTest: true,
98+
hitTest: { required: true },
9799
planeDetection: { required: true },
98100
meshDetection: { required: true },
99101
anchors: { required: true },
102+
unbounded: { required: true },
100103
},
101104
},
102105
features: {

packages/core/src/init/xr.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export type XRFeatureOptions = {
5656
* You may set `{ required: true }` to require layers.
5757
*/
5858
layers?: FeatureFlag;
59+
unbounded?: FeatureFlag;
5960
};
6061

6162
/** Reference space configuration. @category Runtime */
@@ -120,6 +121,7 @@ export function buildSessionInit(opts: XROptions): XRSessionInit {
120121
lightEstimation: 'light-estimation',
121122
depthSensing: 'depth-sensing',
122123
layers: 'layers',
124+
unbounded: 'unbounded',
123125
} as const;
124126

125127
const push = (
@@ -145,6 +147,7 @@ export function buildSessionInit(opts: XROptions): XRSessionInit {
145147
push('meshDetection', normalizeFlag(f.meshDetection));
146148
push('lightEstimation', normalizeFlag(f.lightEstimation));
147149
push('layers', normalizeFlag(f.layers));
150+
push('unbounded', normalizeFlag(f.unbounded));
148151

149152
// Depth sensing (may include preferences)
150153
if (f.depthSensing) {

0 commit comments

Comments
 (0)