@reactvision/react-viro 2.57.0 → 2.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +8 -0
  2. package/android/react_viro/react_viro-release.aar +0 -0
  3. package/android/viro_renderer/viro_renderer-release.aar +0 -0
  4. package/components/AR/ViroARPlane.tsx +1 -4
  5. package/components/AR/ViroARPlaneSelector.tsx +10 -5
  6. package/components/AR/ViroARScene.tsx +2 -4
  7. package/components/AR/ViroARSceneNavigator.tsx +11 -3
  8. package/components/Studio/StudioARScene.tsx +243 -48
  9. package/components/Studio/StudioSceneNavigator.tsx +15 -0
  10. package/components/Studio/VRTStudioModule.ts +10 -0
  11. package/components/Studio/domain/StudioSounds.tsx +46 -0
  12. package/components/Studio/domain/apiRequestHelpers.ts +612 -0
  13. package/components/Studio/domain/collisionBindingsRuntime.ts +17 -2
  14. package/components/Studio/domain/defaultApiRequestExecutor.ts +61 -0
  15. package/components/Studio/domain/expressionEvaluator.ts +603 -0
  16. package/components/Studio/domain/sceneNavigationHandler.ts +770 -20
  17. package/components/Studio/domain/soundManager.ts +141 -0
  18. package/components/Studio/domain/utils.ts +50 -0
  19. package/components/Studio/domain/variableStore.ts +74 -0
  20. package/components/Studio/domain/viroNodeFactory.tsx +175 -44
  21. package/components/Studio/domain/visibilityStore.ts +66 -0
  22. package/components/Studio/index.ts +1 -0
  23. package/components/Studio/types.ts +178 -1
  24. package/components/Utilities/VRModuleOpenXR.ts +35 -0
  25. package/components/Utilities/ViroVersion.ts +1 -1
  26. package/components/ViroAnimatedImage.tsx +1 -0
  27. package/components/ViroFlexView.tsx +1 -0
  28. package/components/ViroImage.tsx +1 -0
  29. package/components/ViroObjectDetector.tsx +13 -5
  30. package/components/ViroParticleEmitter.tsx +2 -0
  31. package/components/ViroPolygon.tsx +2 -1
  32. package/components/ViroQuad.tsx +2 -1
  33. package/components/ViroSurface.tsx +1 -0
  34. package/components/ViroVideo.tsx +1 -0
  35. package/components/ViroXRSceneNavigator.tsx +8 -0
  36. package/dist/components/AR/ViroARPlane.d.ts +1 -1
  37. package/dist/components/AR/ViroARPlane.js +1 -5
  38. package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
  39. package/dist/components/AR/ViroARPlaneSelector.js +10 -5
  40. package/dist/components/AR/ViroARScene.d.ts +1 -1
  41. package/dist/components/AR/ViroARScene.js +2 -5
  42. package/dist/components/AR/ViroARSceneNavigator.d.ts +11 -3
  43. package/dist/components/Studio/StudioARScene.d.ts +3 -0
  44. package/dist/components/Studio/StudioARScene.js +142 -15
  45. package/dist/components/Studio/StudioSceneNavigator.js +14 -0
  46. package/dist/components/Studio/VRTStudioModule.d.ts +6 -0
  47. package/dist/components/Studio/VRTStudioModule.js +10 -0
  48. package/dist/components/Studio/domain/StudioSounds.d.ts +11 -0
  49. package/dist/components/Studio/domain/StudioSounds.js +69 -0
  50. package/dist/components/Studio/domain/apiRequestHelpers.d.ts +180 -0
  51. package/dist/components/Studio/domain/apiRequestHelpers.js +496 -0
  52. package/dist/components/Studio/domain/collisionBindingsRuntime.d.ts +3 -1
  53. package/dist/components/Studio/domain/collisionBindingsRuntime.js +4 -3
  54. package/dist/components/Studio/domain/defaultApiRequestExecutor.d.ts +14 -0
  55. package/dist/components/Studio/domain/defaultApiRequestExecutor.js +58 -0
  56. package/dist/components/Studio/domain/expressionEvaluator.d.ts +108 -0
  57. package/dist/components/Studio/domain/expressionEvaluator.js +520 -0
  58. package/dist/components/Studio/domain/sceneNavigationHandler.d.ts +35 -8
  59. package/dist/components/Studio/domain/sceneNavigationHandler.js +564 -22
  60. package/dist/components/Studio/domain/soundManager.d.ts +52 -0
  61. package/dist/components/Studio/domain/soundManager.js +118 -0
  62. package/dist/components/Studio/domain/utils.d.ts +16 -0
  63. package/dist/components/Studio/domain/utils.js +48 -0
  64. package/dist/components/Studio/domain/variableStore.d.ts +21 -0
  65. package/dist/components/Studio/domain/variableStore.js +65 -0
  66. package/dist/components/Studio/domain/viroNodeFactory.d.ts +4 -9
  67. package/dist/components/Studio/domain/viroNodeFactory.js +84 -25
  68. package/dist/components/Studio/domain/visibilityStore.d.ts +33 -0
  69. package/dist/components/Studio/domain/visibilityStore.js +66 -0
  70. package/dist/components/Studio/index.d.ts +1 -1
  71. package/dist/components/Studio/types.d.ts +150 -1
  72. package/dist/components/Utilities/VRModuleOpenXR.d.ts +19 -0
  73. package/dist/components/Utilities/VRModuleOpenXR.js +16 -0
  74. package/dist/components/Utilities/ViroVersion.d.ts +1 -1
  75. package/dist/components/Utilities/ViroVersion.js +1 -1
  76. package/dist/components/ViroAnimatedImage.js +1 -0
  77. package/dist/components/ViroFlexView.js +1 -0
  78. package/dist/components/ViroImage.js +1 -0
  79. package/dist/components/ViroObjectDetector.d.ts +13 -5
  80. package/dist/components/ViroObjectDetector.js +13 -5
  81. package/dist/components/ViroParticleEmitter.js +2 -0
  82. package/dist/components/ViroPolygon.js +1 -0
  83. package/dist/components/ViroQuad.js +1 -0
  84. package/dist/components/ViroSurface.js +1 -0
  85. package/dist/components/ViroVideo.js +1 -0
  86. package/dist/components/ViroXRSceneNavigator.d.ts +8 -0
  87. package/dist/index.d.ts +4 -4
  88. package/dist/index.js +2 -1
  89. package/dist/plugins/withViroAndroid.js +18 -0
  90. package/index.ts +4 -3
  91. package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreCoreMLSemanticsResources.bundle/Info.plist +0 -0
  92. package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreResources.bundle/Info.plist +0 -0
  93. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARFrameiOS.h +8 -0
  94. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +14 -3
  95. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROFrontCameraProvider.h +34 -0
  96. package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROViewAR.h +3 -1
  97. package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
  98. package/ios/dist/ViroRenderer/ViroKit.framework/Shaders.dat +1 -1
  99. package/ios/dist/ViroRenderer/ViroKit.framework/ViroKit +0 -0
  100. package/ios/dist/lib/libViroReact.a +0 -0
  101. package/package.json +11 -11
@@ -18,13 +18,131 @@ export interface StudioProjectMeta {
18
18
  id: string;
19
19
  occlusion_mode: "NONE" | "PEOPLEONLY" | "DEPTHBASED";
20
20
  }
21
+ /**
22
+ * One ordered step of a Sequence: an ACTION (runs a function), a WAIT (timed
23
+ * pause), or a STOP (explicit terminal — the run halts here).
24
+ */
25
+ export interface StudioSequenceStep {
26
+ id: string;
27
+ step_order: number;
28
+ step_type: "ACTION" | "WAIT" | "STOP";
29
+ duration_ms: number | null;
30
+ function_id: string | null;
31
+ function: StudioSceneFunction | null;
32
+ advance_immediately: boolean;
33
+ }
34
+ export interface StudioSequence {
35
+ id: string;
36
+ name: string | null;
37
+ steps: StudioSequenceStep[];
38
+ }
39
+ /** Scene-level variable declaration. Runtime state lives in StudioVariableStore. */
40
+ export interface StudioSceneVariable {
41
+ id: string;
42
+ name: string;
43
+ type: "BOOLEAN" | "NUMBER" | "STRING";
44
+ initial_value: boolean | number | string;
45
+ }
46
+ /**
47
+ * One ordered predicate arm of a BRANCH. Variable names/types are joined from
48
+ * project_variables so they follow renames. The arm is an owned, headless
49
+ * sequence run like a nested sequence.
50
+ */
51
+ export interface StudioBranchCondition {
52
+ id: string;
53
+ eval_order: number;
54
+ variable_id: string;
55
+ variable_name: string;
56
+ variable_type: "BOOLEAN" | "NUMBER" | "STRING";
57
+ comparison: "EQUALS" | "NOT_EQUALS" | "GREATER_THAN" | "LESS_THAN" | "GREATER_OR_EQUAL" | "LESS_OR_EQUAL" | "LIKE" | "ILIKE";
58
+ compare_literal: boolean | number | string | null;
59
+ compare_variable_id: string | null;
60
+ compare_variable_name: string | null;
61
+ compare_variable_type: "BOOLEAN" | "NUMBER" | "STRING" | null;
62
+ sequence: StudioSequence;
63
+ }
64
+ /**
65
+ * BRANCH payload. Conditions are evaluated in eval_order (first match wins),
66
+ * falling through to the optional no-match arm. Arms are owned, headless
67
+ * sequences run like nested sequences.
68
+ */
69
+ export interface StudioSceneBranch {
70
+ id: string;
71
+ conditions: StudioBranchCondition[];
72
+ no_match_sequence: StudioSequence | null;
73
+ }
74
+ /**
75
+ * GROUP payload. Owns N lanes, each an owned headless sequence run like a
76
+ * nested sequence. Lanes run concurrently; the group completes when all lanes
77
+ * complete (barrier join).
78
+ */
79
+ export interface StudioSceneGroup {
80
+ id: string;
81
+ lanes: {
82
+ lane_order: number;
83
+ sequence: StudioSequence;
84
+ }[];
85
+ }
86
+ /** One response->variable binding of an API_REQUEST function. */
87
+ export interface StudioApiRequestBinding {
88
+ id: string;
89
+ source: "BODY" | "STATUS" | "OK" | "ERROR_MESSAGE";
90
+ selector: string | null;
91
+ variable_id: string;
92
+ variable_name: string;
93
+ variable_type: "BOOLEAN" | "NUMBER" | "STRING";
94
+ bind_order: number;
95
+ }
96
+ /**
97
+ * API_REQUEST payload. The HTTP call executes server-side through the
98
+ * platform egress proxy (the client only ever sends the function id plus
99
+ * current variable values); connection_id is an opaque server-side
100
+ * reference. Arms are owned, headless sequences run like nested sequences.
101
+ */
102
+ export interface StudioSceneApiRequest {
103
+ id: string;
104
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
105
+ url_template: string;
106
+ headers: {
107
+ key: string;
108
+ value_template: string;
109
+ }[];
110
+ body_template: string | null;
111
+ timeout_ms: number;
112
+ connection_id: string | null;
113
+ bindings: StudioApiRequestBinding[];
114
+ success_sequence: StudioSequence | null;
115
+ failure_sequence: StudioSequence | null;
116
+ }
117
+ /** Outcome envelope an API-request executor resolves with. */
118
+ export interface StudioApiRequestOutcome {
119
+ ok: boolean;
120
+ status: number | null;
121
+ body?: unknown;
122
+ error_code?: string | null;
123
+ error_message?: string | null;
124
+ }
125
+ /**
126
+ * Host-app transport for API_REQUEST functions: StudioGo calls the
127
+ * scene-api-request edge function with the user JWT; production Viro apps
128
+ * call it with their X-API-Key. Must resolve with an outcome (reject only on
129
+ * transport failure).
130
+ */
131
+ export type StudioApiRequestExecutor = (functionId: string, variables: Record<string, boolean | number | string>) => Promise<StudioApiRequestOutcome>;
21
132
  export interface StudioSceneFunction {
22
133
  id: string;
23
134
  scene: string;
24
- function_type: "NAVIGATION" | "ALERT" | "ANIMATION";
135
+ function_type: "NAVIGATION" | "ALERT" | "ANIMATION" | "SEQUENCE" | "SET_VARIABLE" | "BRANCH" | "API_REQUEST" | "SET_VISIBILITY" | "SOUND" | "GROUP";
25
136
  navigation: string | null;
26
137
  alert: string | null;
27
138
  animation: string | null;
139
+ sequence: string | null;
140
+ set_variable: string | null;
141
+ branch: string | null;
142
+ api_request: string | null;
143
+ set_visibility: string | null;
144
+ sound: string | null;
145
+ group_fn: string | null;
28
146
  scene_navigation: {
29
147
  id: string;
30
148
  navigate_to: string;
@@ -41,6 +159,33 @@ export interface StudioSceneFunction {
41
159
  delay_ms: number | null;
42
160
  properties: Record<string, unknown>;
43
161
  } | null;
162
+ scene_sequence: StudioSequence | null;
163
+ /** name/type are joined from the target scene_variables row, so they follow renames. */
164
+ scene_set_variable: {
165
+ id: string;
166
+ variable_id: string;
167
+ name: string;
168
+ type: "BOOLEAN" | "NUMBER" | "STRING";
169
+ expression: string;
170
+ } | null;
171
+ scene_branch: StudioSceneBranch | null;
172
+ scene_api_request: StudioSceneApiRequest | null;
173
+ scene_set_visibility: {
174
+ id: string;
175
+ target_asset_id: string;
176
+ state: "VISIBLE" | "HIDDEN" | "TOGGLE";
177
+ } | null;
178
+ scene_sound: {
179
+ id: string;
180
+ action: "PLAY" | "STOP";
181
+ audio_asset_id: string | null;
182
+ audio_url: string | null;
183
+ target_asset_id: string | null;
184
+ volume: number;
185
+ loop: boolean;
186
+ stop_other_sounds: boolean;
187
+ } | null;
188
+ scene_group: StudioSceneGroup | null;
44
189
  }
45
190
  export interface StudioAsset {
46
191
  id: string;
@@ -59,6 +204,8 @@ export interface StudioAsset {
59
204
  latitude: number | null;
60
205
  longitude: number | null;
61
206
  is_draggable: boolean;
207
+ /** Author-time "hidden on start"; the runtime seeds visibility from it. */
208
+ hidden_on_load: boolean | null;
62
209
  trigger_image_url: string | null;
63
210
  trigger_image_orientation: "Up" | "Down" | "Left" | "Right" | null;
64
211
  trigger_image_physical_width_m: number | null;
@@ -133,6 +280,8 @@ export interface StudioSceneResponse {
133
280
  collision_bindings: StudioCollisionBinding[];
134
281
  animations: StudioAnimation[];
135
282
  functions: StudioSceneFunction[];
283
+ /** Absent in responses from backends predating the Variables feature. */
284
+ variables?: StudioSceneVariable[];
136
285
  meta: {
137
286
  request_id: string;
138
287
  };
@@ -6,7 +6,26 @@ export declare function exitVRScene(): void;
6
6
  export type VRModuleOpenXRType = {
7
7
  recenterTracking?: (viewTag: number) => void;
8
8
  setPassthroughEnabled?: (viewTag: number, enabled: boolean) => void;
9
+ setPassthroughStyle?: (viewTag: number, opacity: number, edgeR: number, edgeG: number, edgeB: number, edgeA: number) => void;
9
10
  };
11
+ /** Options for {@link setPassthroughStyle}. All channels are normalized [0,1]. */
12
+ export type ViroPassthroughStyle = {
13
+ /** Texture opacity factor [0,1]. Default 1 (fully opaque passthrough). */
14
+ opacity?: number;
15
+ /** Edge-highlight colour [r,g,b,a]. Alpha 0 (default) disables the edge effect. */
16
+ edgeColor?: [number, number, number, number];
17
+ };
18
+ /**
19
+ * Style the Quest passthrough layer (XR_FB_passthrough). No-op off-Quest.
20
+ *
21
+ * ```tsx
22
+ * const viewTag = useVRViewTag();
23
+ * if (viewTag != null) {
24
+ * setPassthroughStyle(viewTag, { opacity: 0.8, edgeColor: [0, 1, 1, 1] });
25
+ * }
26
+ * ```
27
+ */
28
+ export declare function setPassthroughStyle(viewTag: number, style: ViroPassthroughStyle): void;
10
29
  /**
11
30
  * Typed reference to the VRModuleOpenXR native module.
12
31
  * undefined when not running on Meta Quest (no-op calls are safe via optional chaining).
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VRModuleOpenXR = void 0;
4
4
  exports.exitVRScene = exitVRScene;
5
+ exports.setPassthroughStyle = setPassthroughStyle;
5
6
  exports.useVRViewTag = useVRViewTag;
6
7
  const react_1 = require("react");
7
8
  const react_native_1 = require("react-native");
@@ -15,6 +16,21 @@ function exitVRScene() {
15
16
  react_native_1.NativeModules.VRLauncher
16
17
  ?.exitVRScene?.();
17
18
  }
19
+ /**
20
+ * Style the Quest passthrough layer (XR_FB_passthrough). No-op off-Quest.
21
+ *
22
+ * ```tsx
23
+ * const viewTag = useVRViewTag();
24
+ * if (viewTag != null) {
25
+ * setPassthroughStyle(viewTag, { opacity: 0.8, edgeColor: [0, 1, 1, 1] });
26
+ * }
27
+ * ```
28
+ */
29
+ function setPassthroughStyle(viewTag, style) {
30
+ const opacity = style.opacity ?? 1;
31
+ const [r, g, b, a] = style.edgeColor ?? [0, 0, 0, 0];
32
+ exports.VRModuleOpenXR?.setPassthroughStyle?.(viewTag, opacity, r, g, b, a);
33
+ }
18
34
  /**
19
35
  * Typed reference to the VRModuleOpenXR native module.
20
36
  * undefined when not running on Meta Quest (no-op calls are safe via optional chaining).
@@ -1 +1 @@
1
- export declare const VIRO_VERSION = "2.57.0";
1
+ export declare const VIRO_VERSION = "2.57.3";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VIRO_VERSION = void 0;
4
- exports.VIRO_VERSION = "2.57.0";
4
+ exports.VIRO_VERSION = "2.57.3";
@@ -110,6 +110,7 @@ class ViroAnimatedImage extends ViroBase_1.ViroBase {
110
110
  nativeProps.style = [this.props.style];
111
111
  nativeProps.onHoverViro = this._onHover;
112
112
  nativeProps.onClickViro = this._onClickState;
113
+ nativeProps.onClick = undefined;
113
114
  nativeProps.onTouchViro = this._onTouch;
114
115
  nativeProps.onScrollViro = this._onScroll;
115
116
  nativeProps.onSwipeViro = this._onSwipe;
@@ -78,6 +78,7 @@ class ViroFlexView extends ViroBase_1.ViroBase {
78
78
  nativeProps.transformBehaviors = transformBehaviors;
79
79
  nativeProps.onHoverViro = this._onHover;
80
80
  nativeProps.onClickViro = this._onClickState;
81
+ nativeProps.onClick = undefined;
81
82
  nativeProps.onTouchViro = this._onTouch;
82
83
  nativeProps.onScrollViro = this._onScroll;
83
84
  nativeProps.onSwipeViro = this._onSwipe;
@@ -117,6 +117,7 @@ class ViroImage extends ViroBase_1.ViroBase {
117
117
  nativeProps.style = [this.props.style];
118
118
  nativeProps.onHoverViro = this._onHover;
119
119
  nativeProps.onClickViro = this._onClickState;
120
+ nativeProps.onClick = undefined;
120
121
  nativeProps.onTouchViro = this._onTouch;
121
122
  nativeProps.onScrollViro = this._onScroll;
122
123
  nativeProps.onSwipeViro = this._onSwipe;
@@ -114,11 +114,19 @@ type Props = ViewProps & {
114
114
  /**
115
115
  * ViroObjectDetector — on-device open-vocabulary object detection powered by YOLOE.
116
116
  *
117
- * Runs **only in AR**: it shares the camera feed of the enclosing
118
- * `ViroARSceneNavigator` (no separate camera session, no preview of its own) and
119
- * fires `onDetection` with labels, normalized bounding boxes, and an on-screen
120
- * `screenBoundingBox` (dp) at up to `maxFPS`. Mount it as a child or sibling of a
121
- * `ViroARSceneNavigator`; it renders nothing itself, so give it `width: 0, height: 0`.
117
+ * Runs in AR and on Meta Quest:
118
+ * - **Phone AR**: shares the camera feed of the enclosing `ViroARSceneNavigator`
119
+ * (no separate camera session) and fires `onDetection` with labels, normalized
120
+ * bounding boxes, and an on-screen `screenBoundingBox` (dp) at up to `maxFPS`.
121
+ * - **Meta Quest 3 / 3S** (Horizon OS v74+): when mounted in a Quest MR scene
122
+ * (under `ViroXRSceneNavigator`), it captures the headset camera via the Meta
123
+ * Passthrough Camera API and runs the same YOLOE pipeline. Requires the
124
+ * `horizonos.permission.HEADSET_CAMERA` runtime permission. v1 emits `label` +
125
+ * normalized `boundingBox` only — `screenBoundingBox` and `worldPosition` are
126
+ * not provided on Quest yet (they need camera extrinsics).
127
+ *
128
+ * Mount it as a child or sibling of the scene navigator; it renders nothing itself,
129
+ * so give it `width: 0, height: 0`.
122
130
  *
123
131
  * @example
124
132
  * ```tsx
@@ -50,11 +50,19 @@ const VRTObjectDetectorView = (0, react_native_1.requireNativeComponent)("VRTObj
50
50
  /**
51
51
  * ViroObjectDetector — on-device open-vocabulary object detection powered by YOLOE.
52
52
  *
53
- * Runs **only in AR**: it shares the camera feed of the enclosing
54
- * `ViroARSceneNavigator` (no separate camera session, no preview of its own) and
55
- * fires `onDetection` with labels, normalized bounding boxes, and an on-screen
56
- * `screenBoundingBox` (dp) at up to `maxFPS`. Mount it as a child or sibling of a
57
- * `ViroARSceneNavigator`; it renders nothing itself, so give it `width: 0, height: 0`.
53
+ * Runs in AR and on Meta Quest:
54
+ * - **Phone AR**: shares the camera feed of the enclosing `ViroARSceneNavigator`
55
+ * (no separate camera session) and fires `onDetection` with labels, normalized
56
+ * bounding boxes, and an on-screen `screenBoundingBox` (dp) at up to `maxFPS`.
57
+ * - **Meta Quest 3 / 3S** (Horizon OS v74+): when mounted in a Quest MR scene
58
+ * (under `ViroXRSceneNavigator`), it captures the headset camera via the Meta
59
+ * Passthrough Camera API and runs the same YOLOE pipeline. Requires the
60
+ * `horizonos.permission.HEADSET_CAMERA` runtime permission. v1 emits `label` +
61
+ * normalized `boundingBox` only — `screenBoundingBox` and `worldPosition` are
62
+ * not provided on Quest yet (they need camera extrinsics).
63
+ *
64
+ * Mount it as a child or sibling of the scene navigator; it renders nothing itself,
65
+ * so give it `width: 0, height: 0`.
58
66
  *
59
67
  * @example
60
68
  * ```tsx
@@ -102,6 +102,7 @@ class ViroParticleEmitter extends React.Component {
102
102
  : undefined;
103
103
  // Create native props object.
104
104
  let nativeProps = Object.assign({}, this.props);
105
+ nativeProps.onClick = undefined;
105
106
  nativeProps.position = this.state.propsPositionState;
106
107
  nativeProps.onNativeTransformDelegateViro = transformDelegate;
107
108
  nativeProps.hasTransformDelegate =
@@ -175,6 +176,7 @@ class ViroParticleEmitter extends React.Component {
175
176
  };
176
177
  nativeProps.particleAppearance.rotation = newAppearanceRotMod;
177
178
  }
179
+ nativeProps.onClick = undefined;
178
180
  nativeProps.ref = (component) => {
179
181
  this._component = component;
180
182
  };
@@ -80,6 +80,7 @@ class ViroPolygon extends ViroBase_1.ViroBase {
80
80
  nativeProps.style = [this.props.style];
81
81
  nativeProps.onHoverViro = this._onHover;
82
82
  nativeProps.onClickViro = this._onClickState;
83
+ nativeProps.onClick = undefined;
83
84
  nativeProps.onTouchViro = this._onTouch;
84
85
  nativeProps.onScrollViro = this._onScroll;
85
86
  nativeProps.onSwipeViro = this._onSwipe;
@@ -80,6 +80,7 @@ class ViroQuad extends ViroBase_1.ViroBase {
80
80
  nativeProps.style = [this.props.style];
81
81
  nativeProps.onHoverViro = this._onHover;
82
82
  nativeProps.onClickViro = this._onClickState;
83
+ nativeProps.onClick = undefined;
83
84
  nativeProps.onTouchViro = this._onTouch;
84
85
  nativeProps.onScrollViro = this._onScroll;
85
86
  nativeProps.onSwipeViro = this._onSwipe;
@@ -81,6 +81,7 @@ class ViroSurface extends ViroBase_1.ViroBase {
81
81
  nativeProps.style = [this.props.style];
82
82
  nativeProps.onHoverViro = this._onHover;
83
83
  nativeProps.onClickViro = this._onClickState;
84
+ nativeProps.onClick = undefined;
84
85
  nativeProps.onTouchViro = this._onTouch;
85
86
  nativeProps.onScrollViro = this._onScroll;
86
87
  nativeProps.onSwipeViro = this._onSwipe;
@@ -98,6 +98,7 @@ class ViroVideo extends ViroBase_1.ViroBase {
98
98
  nativeProps.onUpdateTimeViro = this._onUpdateTime;
99
99
  nativeProps.onHoverViro = this._onHover;
100
100
  nativeProps.onClickViro = this._onClickState;
101
+ nativeProps.onClick = undefined;
101
102
  nativeProps.onTouchViro = this._onTouch;
102
103
  nativeProps.onScrollViro = this._onScroll;
103
104
  nativeProps.onSwipeViro = this._onSwipe;
@@ -33,6 +33,14 @@ export declare const ViroXRSceneNavigator: React.ForwardRefExoticComponent<ViewP
33
33
  * On Quest, this scene is forwarded to VRActivity via VRQuestNavigatorBridge
34
34
  * rather than rendered inline, because OpenXR exclusive display requires the
35
35
  * VR intent category on the host Activity.
36
+ *
37
+ * The scene root may be either:
38
+ * - `ViroScene` → fully-virtual VR.
39
+ * - `ViroARScene` → mixed reality: passthrough is enabled automatically and
40
+ * real-time plane detection (XR_EXT_plane_detection, Quest 3 / 3S) drives
41
+ * `onAnchorFound` and `ViroARPlane`, exactly as on phone AR. A single
42
+ * AR-rooted `initialScene` therefore runs on phones (ARCore) and Quest (OpenXR)
43
+ * with no per-platform changes. See docs/QUEST_SETUP.md §7b.
36
44
  */
37
45
  vrInitialScene?: SceneFactory;
38
46
  worldAlignment?: "Gravity" | "GravityAndHeading" | "Camera";
package/dist/index.d.ts CHANGED
@@ -75,10 +75,10 @@ import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
75
75
  import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
76
76
  import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
77
77
  import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
78
- import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
79
- import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
78
+ import { VRModuleOpenXR, useVRViewTag, exitVRScene, setPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
79
+ import type { VRModuleOpenXRType, ViroPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
80
80
  import { StreamingAudioManager } from "./components/Utilities/StreamingAudioManager";
81
- export { ViroARImageMarker, ViroARObjectMarker, ViroARTrackingTargets, ViroARPlane, ViroARPlaneSelector, ViroARScene, ViroARSceneNavigator, ViroBox, ViroButton, ViroCamera, ViroController, ViroVirtualJoystick, ViroVirtualButton, ViroGameLoop, ViroGameLoopUtils, useGameLoop, useLateUpdate, useFixedUpdate, ViroDirectionalLight, ViroFlexView, ViroGeometry, ViroLightingEnvironment, ViroImage, ViroMaterials, ViroARCamera, ViroMaterialVideo, ViroCameraTexture, ViroObjectDetector, ViroNode, ViroOmniLight, ViroOrbitCamera, ViroParticleEmitter, ViroPolygon, ViroPolyline, ViroPortal, ViroPortalScene, ViroQuad, ViroScene, ViroSurface, ViroSceneNavigator, ViroSkyBox, ViroAnimations, Viro3DObject, Viro360Image, Viro360Video, ViroAnimatedImage, ViroAmbientLight, ViroAnimatedComponent, ViroSound, ViroSoundField, ViroSpatialSound, ViroSphere, ViroSpinner, ViroSpotLight, ViroText, ViroVideo, ViroVRSceneNavigator, ViroXRSceneNavigator, ViroQuestEntryPoint, VRQuestNavigatorBridge, VRModuleOpenXR, useVRViewTag, exitVRScene, Viro3DSceneNavigator, StreamingAudioManager, hasOpenXRSupport, isQuest, useAnySourceHover, useAnySourcePressed, ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants, polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, latLngToMercator, gpsToArWorld, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroClickStateTypes, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroPinchStateTypes, ViroRotateEvent, ViroRotateStateTypes, ViroDragEvent, ViroPlatformEvent, ViroCollisionEvent, ViroPlatformInfo, ViroCameraTransformEvent, ViroPlatformUpdateEvent, ViroCameraTransform, ViroExitViroEvent, ViroErrorEvent, ViroAnimationStartEvent, ViroAnimationFinishEvent, ViroLoadStartEvent, ViroLoadEndEvent, ViroLoadErrorEvent, ViroVideoBufferStartEvent, ViroVideoBufferEndEvent, ViroVideoUpdateTimeEvent, ViroVideoErrorEvent, ViroVideoFinishEvent, ViroAnimatedComponentStartEvent, ViroAnimatedComponentFinishEvent, ViroARAnchorRemovedEvent, ViroARAnchorUpdatedEvent, ViroARAnchorFoundEvent, ViroAnchor, ViroAnchorFoundMap, ViroAnchorUpdatedMap, ViroPlaneUpdatedMap, ViroPlaneUpdatedEvent, ViroARPlaneSizes, ViroCameraARHitTestEvent, ViroCameraARHitTest, ViroARHitTestResult, ViroARPointCloudUpdateEvent, ViroARPointCloud, ViroTrackingUpdatedEvent, ViroTrackingState, ViroTrackingReason, ViroAmbientLightUpdateEvent, ViroAmbientLightInfo, ViroWorldOrigin, ViroNativeTransformUpdateEvent, ViroControllerStatusEvent, ViroControllerStatus, ViroPortalEnterEvent, ViroPortalExitEvent, ViroSoundFinishEvent, ViroTextStyle, ViroStyle, ViroMaterial, ViroShaderModifiers, ViroShaderUniform, ViroShaderModifier, VIRO_VERSION, ViroProvider, ViroCloudAnchorState, ViroCloudAnchorProvider, ViroCloudAnchor, ViroHostCloudAnchorResult, ViroResolveCloudAnchorResult, ViroCloudAnchorStateChangeEvent, ViroGeospatialAnchorProvider, ViroEarthTrackingState, ViroVPSAvailability, ViroGeospatialAnchorType, ViroQuaternion, ViroGeospatialPose, ViroGeospatialAnchor, ViroGeospatialSupportResult, ViroEarthTrackingStateResult, ViroGeospatialPoseResult, ViroVPSAvailabilityResult, ViroCreateGeospatialAnchorResult, ViroMonocularDepthSupportResult, ViroMonocularDepthModelAvailableResult, ViroMonocularDepthPreferenceResult, ViroJoint, ViroHandJoints, ViroHandPinchEvent, ViroHandUpdateEvent, StudioSceneNavigator, StudioARScene, ViroVisionOSModule, isVisionOS, enterImmersiveSpace, exitImmersiveSpace, };
82
- export type { VRModuleOpenXRType };
81
+ export { ViroARImageMarker, ViroARObjectMarker, ViroARTrackingTargets, ViroARPlane, ViroARPlaneSelector, ViroARScene, ViroARSceneNavigator, ViroBox, ViroButton, ViroCamera, ViroController, ViroVirtualJoystick, ViroVirtualButton, ViroGameLoop, ViroGameLoopUtils, useGameLoop, useLateUpdate, useFixedUpdate, ViroDirectionalLight, ViroFlexView, ViroGeometry, ViroLightingEnvironment, ViroImage, ViroMaterials, ViroARCamera, ViroMaterialVideo, ViroCameraTexture, ViroObjectDetector, ViroNode, ViroOmniLight, ViroOrbitCamera, ViroParticleEmitter, ViroPolygon, ViroPolyline, ViroPortal, ViroPortalScene, ViroQuad, ViroScene, ViroSurface, ViroSceneNavigator, ViroSkyBox, ViroAnimations, Viro3DObject, Viro360Image, Viro360Video, ViroAnimatedImage, ViroAmbientLight, ViroAnimatedComponent, ViroSound, ViroSoundField, ViroSpatialSound, ViroSphere, ViroSpinner, ViroSpotLight, ViroText, ViroVideo, ViroVRSceneNavigator, ViroXRSceneNavigator, ViroQuestEntryPoint, VRQuestNavigatorBridge, VRModuleOpenXR, useVRViewTag, exitVRScene, setPassthroughStyle, Viro3DSceneNavigator, StreamingAudioManager, hasOpenXRSupport, isQuest, useAnySourceHover, useAnySourcePressed, ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants, polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, latLngToMercator, gpsToArWorld, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroClickStateTypes, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroPinchStateTypes, ViroRotateEvent, ViroRotateStateTypes, ViroDragEvent, ViroPlatformEvent, ViroCollisionEvent, ViroPlatformInfo, ViroCameraTransformEvent, ViroPlatformUpdateEvent, ViroCameraTransform, ViroExitViroEvent, ViroErrorEvent, ViroAnimationStartEvent, ViroAnimationFinishEvent, ViroLoadStartEvent, ViroLoadEndEvent, ViroLoadErrorEvent, ViroVideoBufferStartEvent, ViroVideoBufferEndEvent, ViroVideoUpdateTimeEvent, ViroVideoErrorEvent, ViroVideoFinishEvent, ViroAnimatedComponentStartEvent, ViroAnimatedComponentFinishEvent, ViroARAnchorRemovedEvent, ViroARAnchorUpdatedEvent, ViroARAnchorFoundEvent, ViroAnchor, ViroAnchorFoundMap, ViroAnchorUpdatedMap, ViroPlaneUpdatedMap, ViroPlaneUpdatedEvent, ViroARPlaneSizes, ViroCameraARHitTestEvent, ViroCameraARHitTest, ViroARHitTestResult, ViroARPointCloudUpdateEvent, ViroARPointCloud, ViroTrackingUpdatedEvent, ViroTrackingState, ViroTrackingReason, ViroAmbientLightUpdateEvent, ViroAmbientLightInfo, ViroWorldOrigin, ViroNativeTransformUpdateEvent, ViroControllerStatusEvent, ViroControllerStatus, ViroPortalEnterEvent, ViroPortalExitEvent, ViroSoundFinishEvent, ViroTextStyle, ViroStyle, ViroMaterial, ViroShaderModifiers, ViroShaderUniform, ViroShaderModifier, VIRO_VERSION, ViroProvider, ViroCloudAnchorState, ViroCloudAnchorProvider, ViroCloudAnchor, ViroHostCloudAnchorResult, ViroResolveCloudAnchorResult, ViroCloudAnchorStateChangeEvent, ViroGeospatialAnchorProvider, ViroEarthTrackingState, ViroVPSAvailability, ViroGeospatialAnchorType, ViroQuaternion, ViroGeospatialPose, ViroGeospatialAnchor, ViroGeospatialSupportResult, ViroEarthTrackingStateResult, ViroGeospatialPoseResult, ViroVPSAvailabilityResult, ViroCreateGeospatialAnchorResult, ViroMonocularDepthSupportResult, ViroMonocularDepthModelAvailableResult, ViroMonocularDepthPreferenceResult, ViroJoint, ViroHandJoints, ViroHandPinchEvent, ViroHandUpdateEvent, StudioSceneNavigator, StudioARScene, ViroVisionOSModule, isVisionOS, enterImmersiveSpace, exitImmersiveSpace, };
82
+ export type { VRModuleOpenXRType, ViroPassthroughStyle };
83
83
  export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
84
84
  export type { StudioSceneResponse, StudioAsset, StudioAnimation, StudioCollisionBinding, StudioSceneFunction, StudioSceneMeta, StudioProjectMeta, } from "./components/Studio";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ViroSoundField = exports.ViroSound = exports.ViroAnimatedComponent = exports.ViroAmbientLight = exports.ViroAnimatedImage = exports.Viro360Video = exports.Viro360Image = exports.Viro3DObject = exports.ViroAnimations = exports.ViroSkyBox = exports.ViroSceneNavigator = exports.ViroSurface = exports.ViroScene = exports.ViroQuad = exports.ViroPortalScene = exports.ViroPortal = exports.ViroPolyline = exports.ViroPolygon = exports.ViroParticleEmitter = exports.ViroOrbitCamera = exports.ViroOmniLight = exports.ViroNode = exports.ViroObjectDetector = exports.ViroCameraTexture = exports.ViroMaterialVideo = exports.ViroARCamera = exports.ViroMaterials = exports.ViroImage = exports.ViroLightingEnvironment = exports.ViroGeometry = exports.ViroFlexView = exports.ViroDirectionalLight = exports.useFixedUpdate = exports.useLateUpdate = exports.useGameLoop = exports.ViroGameLoopUtils = exports.ViroGameLoop = exports.ViroVirtualButton = exports.ViroVirtualJoystick = exports.ViroController = exports.ViroCamera = exports.ViroButton = exports.ViroBox = exports.ViroARSceneNavigator = exports.ViroARScene = exports.ViroARPlaneSelector = exports.ViroARPlane = exports.ViroARTrackingTargets = exports.ViroARObjectMarker = exports.ViroARImageMarker = void 0;
4
- exports.exitImmersiveSpace = exports.enterImmersiveSpace = exports.isVisionOS = exports.ViroVisionOSModule = exports.StudioARScene = exports.StudioSceneNavigator = exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.checkPermissions = exports.requestRequiredPermissions = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = exports.ViroARTrackingReasonConstants = exports.useAnySourcePressed = exports.useAnySourceHover = exports.isQuest = exports.hasOpenXRSupport = exports.StreamingAudioManager = exports.Viro3DSceneNavigator = exports.exitVRScene = exports.useVRViewTag = exports.VRModuleOpenXR = exports.VRQuestNavigatorBridge = exports.ViroQuestEntryPoint = exports.ViroXRSceneNavigator = exports.ViroVRSceneNavigator = exports.ViroVideo = exports.ViroText = exports.ViroSpotLight = exports.ViroSpinner = exports.ViroSphere = exports.ViroSpatialSound = void 0;
4
+ exports.exitImmersiveSpace = exports.enterImmersiveSpace = exports.isVisionOS = exports.ViroVisionOSModule = exports.StudioARScene = exports.StudioSceneNavigator = exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.checkPermissions = exports.requestRequiredPermissions = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = exports.ViroARTrackingReasonConstants = exports.useAnySourcePressed = exports.useAnySourceHover = exports.isQuest = exports.hasOpenXRSupport = exports.StreamingAudioManager = exports.Viro3DSceneNavigator = exports.setPassthroughStyle = exports.exitVRScene = exports.useVRViewTag = exports.VRModuleOpenXR = exports.VRQuestNavigatorBridge = exports.ViroQuestEntryPoint = exports.ViroXRSceneNavigator = exports.ViroVRSceneNavigator = exports.ViroVideo = exports.ViroText = exports.ViroSpotLight = exports.ViroSpinner = exports.ViroSphere = exports.ViroSpatialSound = void 0;
5
5
  /**
6
6
  * Copyright (c) 2016-present, Viro Media, Inc.
7
7
  * All rights reserved.
@@ -164,6 +164,7 @@ const VRModuleOpenXR_1 = require("./components/Utilities/VRModuleOpenXR");
164
164
  Object.defineProperty(exports, "VRModuleOpenXR", { enumerable: true, get: function () { return VRModuleOpenXR_1.VRModuleOpenXR; } });
165
165
  Object.defineProperty(exports, "useVRViewTag", { enumerable: true, get: function () { return VRModuleOpenXR_1.useVRViewTag; } });
166
166
  Object.defineProperty(exports, "exitVRScene", { enumerable: true, get: function () { return VRModuleOpenXR_1.exitVRScene; } });
167
+ Object.defineProperty(exports, "setPassthroughStyle", { enumerable: true, get: function () { return VRModuleOpenXR_1.setPassthroughStyle; } });
167
168
  const StreamingAudioManager_1 = require("./components/Utilities/StreamingAudioManager");
168
169
  Object.defineProperty(exports, "StreamingAudioManager", { enumerable: true, get: function () { return StreamingAudioManager_1.StreamingAudioManager; } });
169
170
  const react_native_1 = require("react-native");
@@ -343,6 +343,24 @@ const withViroManifest = (config) => (0, config_plugins_1.withAndroidManifest)(c
343
343
  $: { "android:name": "com.oculus.permission.EYE_TRACKING" },
344
344
  });
345
345
  }
346
+ // Spatial Data / Scene permissions — required for the Meta OpenXR runtime
347
+ // to expose the scene & spatial-entity extensions (XR_FB_scene,
348
+ // XR_FB_spatial_entity*, XR_FB_scene_capture). Without USE_ANCHOR_API the
349
+ // runtime skips those extensions, so plane / anchor data is unavailable on
350
+ // Quest. These are runtime permissions — also require a grant at runtime.
351
+ const sceneAnchorPerms = [
352
+ "horizonos.permission.USE_ANCHOR_API", // gates XR_FB_scene / XR_FB_spatial_entity on current Horizon OS
353
+ "com.oculus.permission.USE_SCENE", // legacy Scene permission (older OS)
354
+ // Meta Passthrough Camera API (Quest 3 / 3S, Horizon OS v74+): grants the
355
+ // app the headset RGB cameras via Camera2, used by ViroObjectDetector to
356
+ // run on-device object detection over passthrough. Runtime-granted.
357
+ "horizonos.permission.HEADSET_CAMERA",
358
+ ];
359
+ for (const perm of sceneAnchorPerms) {
360
+ if (!existingPermissions.includes(perm)) {
361
+ contents.manifest["uses-permission"].push({ $: { "android:name": perm } });
362
+ }
363
+ }
346
364
  }
347
365
  return newConfig;
348
366
  });
package/index.ts CHANGED
@@ -187,8 +187,8 @@ import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
187
187
  import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
188
188
  import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
189
189
  import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
190
- import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
191
- import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
190
+ import { VRModuleOpenXR, useVRViewTag, exitVRScene, setPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
191
+ import type { VRModuleOpenXRType, ViroPassthroughStyle } from "./components/Utilities/VRModuleOpenXR";
192
192
  import { StreamingAudioManager } from "./components/Utilities/StreamingAudioManager";
193
193
  import { AppRegistry } from "react-native";
194
194
 
@@ -262,6 +262,7 @@ export {
262
262
  VRModuleOpenXR,
263
263
  useVRViewTag,
264
264
  exitVRScene,
265
+ setPassthroughStyle,
265
266
  Viro3DSceneNavigator,
266
267
  // Streaming audio
267
268
  StreamingAudioManager,
@@ -391,7 +392,7 @@ export {
391
392
  exitImmersiveSpace,
392
393
  };
393
394
 
394
- export type { VRModuleOpenXRType };
395
+ export type { VRModuleOpenXRType, ViroPassthroughStyle };
395
396
  export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
396
397
 
397
398
  export type {
@@ -144,6 +144,14 @@ private:
144
144
  */
145
145
  float sampleDepthTextureAtUV(std::shared_ptr<VROTexture> texture, float u, float v) const;
146
146
 
147
+ /*
148
+ Sample the LiDAR depth confidence at normalized UV coordinates (0-1 range).
149
+ Reads ARKit's ARDepthData.confidenceMap (ARConfidenceLevel: 0=low, 1=medium, 2=high)
150
+ and normalizes to [0,1] (low=0.0, medium=0.5, high=1.0). Returns -1.0 when confidence
151
+ is unavailable (no LiDAR / no confidence map).
152
+ */
153
+ float sampleConfidenceAtUV(float u, float v) const;
154
+
147
155
  /*
148
156
  Unproject a camera-image-space point (normalized [0,1] in ARKit's landscape image
149
157
  space, the same space used for [ARFrame hitTest:]) at a given metric depth (meters
@@ -126,8 +126,19 @@ public:
126
126
  void setPreferMonocularDepth(bool prefer);
127
127
  bool isPreferMonocularDepth() const;
128
128
 
129
- // Use the front (TrueDepth) camera via ARFaceTrackingConfiguration.
130
- // When true, world tracking, planes, and LiDAR are unavailable.
129
+ // Front-camera AR is supplied by an optional external module so that ViroKit
130
+ // itself never references the ARKit face-tracking / TrueDepth API. Apps that
131
+ // need it install @reactvision/react-viro-face-tracking, which registers a
132
+ // provider here. The provider returns a ready-to-run front-camera
133
+ // ARConfiguration (or nil if the device is unsupported). When no provider is
134
+ // registered, setFrontCameraEnabled(true) has no effect and AR falls through
135
+ // to world tracking.
136
+ typedef ARConfiguration * _Nullable (^VROARFrontCameraConfigProvider)(void);
137
+ static void setFrontCameraConfigProvider(VROARFrontCameraConfigProvider provider);
138
+
139
+ // Enable/disable front-camera AR. Requires a registered config provider
140
+ // (see setFrontCameraConfigProvider); otherwise it is a no-op. When active,
141
+ // world tracking, planes, and LiDAR are unavailable.
131
142
  void setFrontCameraEnabled(bool enabled);
132
143
  bool isFrontCameraEnabled() const { return _frontCameraEnabled; }
133
144
 
@@ -371,7 +382,7 @@ private:
371
382
  std::shared_ptr<VROMonocularDepthEstimator> _monocularDepthEstimator;
372
383
  bool _monocularDepthEnabled;
373
384
  bool _preferMonocularDepth; // When true, use monocular even on LiDAR devices
374
- bool _frontCameraEnabled; // When true, use ARFaceTrackingConfiguration (front camera)
385
+ bool _frontCameraEnabled; // When true and a config provider is registered, use front-camera AR
375
386
  bool _monocularDepthLoading;
376
387
  float _monocularDepthScale; // Multiplied into depth values (1.0 = no change)
377
388
  int _monocularDepthTargetFPS; // 0 = use estimator default
@@ -0,0 +1,34 @@
1
+ //
2
+ // VROFrontCameraProvider.h
3
+ // ViroKit
4
+ //
5
+ // Copyright © 2026 ReactVision. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <ARKit/ARKit.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ /**
14
+ * VROFrontCameraProvider — Objective-C registration host for front-camera AR.
15
+ *
16
+ * ViroKit itself does NOT reference the ARKit face-tracking / TrueDepth API. An
17
+ * optional external module (@reactvision/react-viro-face-tracking) supplies a
18
+ * front-camera ARConfiguration by calling +registerConfigProvider:. That module
19
+ * discovers this class at runtime via NSClassFromString, so ViroKit carries no
20
+ * build- or link-time dependency on it (mirrors how react-viro-onnx registers
21
+ * against VRTObjectDetectorView).
22
+ *
23
+ * The registered block returns a ready-to-run front-camera ARConfiguration, or
24
+ * nil if the device does not support it. It is stored process-wide and consulted
25
+ * by VROARSessioniOS whenever front-camera AR is requested.
26
+ */
27
+ @interface VROFrontCameraProvider : NSObject
28
+
29
+ /** Register the front-camera config provider used by VROARSessioniOS (idempotent). */
30
+ + (void)registerConfigProvider:(ARConfiguration * _Nullable (^)(void))provider;
31
+
32
+ @end
33
+
34
+ NS_ASSUME_NONNULL_END
@@ -194,7 +194,9 @@ enum class VROCameraPosition;
194
194
  // Target inference rate for monocular depth. Thermal state overrides downward automatically.
195
195
  - (void)setMonocularDepthTargetFPS:(int)fps;
196
196
 
197
- // Switch to ARFaceTrackingConfiguration (front TrueDepth camera) when YES.
197
+ // Switch to front-camera AR when YES. Requires the optional face-tracking
198
+ // module to be installed (see VROARSessioniOS::setFrontCameraConfigProvider);
199
+ // otherwise this has no effect.
198
200
  - (void)setFrontCameraEnabled:(BOOL)enabled;
199
201
 
200
202
  @end
@@ -1,5 +1,5 @@
1
1
  dependencies: \
2
2
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/Shaders.metal \
3
- /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.6.42.0.h0RVpk/Metal.xctoolchain/usr/metal/32023/lib/clang/32023.883/include/metal/module.modulemap \
3
+ /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.6.109.0.qEW6mp/Metal.xctoolchain/usr/metal/32023/lib/clang/32023.883/include/metal/module.modulemap \
4
4
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/VROSharedStructures.h \
5
5
  /Users/dorantes/Documents/ViroWorkspace/virocore/ViroRenderer/VRODefines.h
Binary file