@reactvision/react-viro 2.53.1 → 2.55.0
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.
- package/README.md +85 -46
- package/android/react_viro/react_viro-release.aar +0 -0
- package/android/viro_renderer/viro_renderer-release.aar +0 -0
- package/components/AR/ViroARCamera.tsx +5 -0
- package/components/AR/ViroARImageMarker.tsx +5 -0
- package/components/AR/ViroARObjectMarker.tsx +5 -0
- package/components/AR/ViroARPlane.tsx +5 -0
- package/components/AR/ViroARPlaneSelector.tsx +5 -0
- package/components/AR/ViroARScene.tsx +5 -0
- package/components/AR/ViroARSceneNavigator.tsx +84 -0
- package/components/AR/ViroCommonProps.ts +11 -0
- package/components/Material/ViroMaterials.ts +51 -0
- package/components/Studio/StudioARScene.tsx +368 -0
- package/components/Studio/StudioSceneNavigator.tsx +191 -0
- package/components/Studio/VRTStudioModule.ts +40 -0
- package/components/Studio/domain/animationRegistry.ts +86 -0
- package/components/Studio/domain/collisionBindingsRuntime.ts +93 -0
- package/components/Studio/domain/collisionPairKey.ts +15 -0
- package/components/Studio/domain/dragConfiguration.ts +48 -0
- package/components/Studio/domain/materialConfig.ts +276 -0
- package/components/Studio/domain/physicsConfig.ts +204 -0
- package/components/Studio/domain/sceneNavigationHandler.ts +150 -0
- package/components/Studio/domain/studioMaterials.ts +33 -0
- package/components/Studio/domain/triggerImageRegistry.ts +64 -0
- package/components/Studio/domain/useStudioShaderTimeUniforms.ts +51 -0
- package/components/Studio/domain/useStudioShaderViewportUniforms.ts +52 -0
- package/components/Studio/domain/viroNodeFactory.tsx +323 -0
- package/components/Studio/index.ts +18 -0
- package/components/Studio/types.ts +164 -0
- package/components/Types/ViroEvents.ts +53 -0
- package/components/Utilities/VRModuleOpenXR.ts +50 -0
- package/components/Utilities/VRQuestNavigatorBridge.ts +168 -0
- package/components/Utilities/ViroPlatform.ts +52 -0
- package/components/Utilities/ViroUtils.tsx +48 -0
- package/components/Utilities/ViroVersion.ts +1 -1
- package/components/Utilities/useAnySourceHover.ts +55 -0
- package/components/Utilities/useAnySourcePressed.ts +70 -0
- package/components/Viro360Image.tsx +7 -0
- package/components/ViroQuestEntryPoint.tsx +79 -0
- package/components/ViroVRSceneNavigator.tsx +44 -19
- package/components/ViroXRSceneNavigator.tsx +217 -0
- package/components/VisionOS/ViroVisionOSModule.ts +93 -0
- package/dist/components/AR/ViroARCamera.d.ts +1 -1
- package/dist/components/AR/ViroARCamera.js +5 -0
- package/dist/components/AR/ViroARImageMarker.d.ts +1 -1
- package/dist/components/AR/ViroARImageMarker.js +5 -0
- package/dist/components/AR/ViroARObjectMarker.d.ts +1 -1
- package/dist/components/AR/ViroARObjectMarker.js +5 -0
- package/dist/components/AR/ViroARPlane.d.ts +1 -1
- package/dist/components/AR/ViroARPlane.js +5 -0
- package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
- package/dist/components/AR/ViroARPlaneSelector.js +5 -0
- package/dist/components/AR/ViroARScene.d.ts +1 -1
- package/dist/components/AR/ViroARScene.js +5 -0
- package/dist/components/AR/ViroARSceneNavigator.d.ts +36 -0
- package/dist/components/AR/ViroARSceneNavigator.js +41 -0
- package/dist/components/AR/ViroCommonProps.d.ts +11 -0
- package/dist/components/Material/ViroMaterials.d.ts +12 -0
- package/dist/components/Material/ViroMaterials.js +25 -0
- package/dist/components/ReactVisionClient.d.ts +25 -0
- package/dist/components/ReactVisionClient.js +11 -0
- package/dist/components/Studio/StudioARScene.d.ts +15 -0
- package/dist/components/Studio/StudioARScene.js +299 -0
- package/dist/components/Studio/StudioSceneNavigator.d.ts +31 -0
- package/dist/components/Studio/StudioSceneNavigator.js +174 -0
- package/dist/components/Studio/VRTStudioModule.d.ts +15 -0
- package/dist/components/Studio/VRTStudioModule.js +31 -0
- package/dist/components/Studio/domain/animationRegistry.d.ts +11 -0
- package/dist/components/Studio/domain/animationRegistry.js +67 -0
- package/dist/components/Studio/domain/collisionBindingsRuntime.d.ts +21 -0
- package/dist/components/Studio/domain/collisionBindingsRuntime.js +54 -0
- package/dist/components/Studio/domain/collisionPairKey.d.ts +8 -0
- package/dist/components/Studio/domain/collisionPairKey.js +15 -0
- package/dist/components/Studio/domain/dragConfiguration.d.ts +20 -0
- package/dist/components/Studio/domain/dragConfiguration.js +37 -0
- package/dist/components/Studio/domain/materialConfig.d.ts +56 -0
- package/dist/components/Studio/domain/materialConfig.js +239 -0
- package/dist/components/Studio/domain/physicsConfig.d.ts +69 -0
- package/dist/components/Studio/domain/physicsConfig.js +165 -0
- package/dist/components/Studio/domain/sceneNavigationHandler.d.ts +12 -0
- package/dist/components/Studio/domain/sceneNavigationHandler.js +112 -0
- package/dist/components/Studio/domain/studioMaterials.d.ts +6 -0
- package/dist/components/Studio/domain/studioMaterials.js +30 -0
- package/dist/components/Studio/domain/triggerImageRegistry.d.ts +13 -0
- package/dist/components/Studio/domain/triggerImageRegistry.js +47 -0
- package/dist/components/Studio/domain/useStudioShaderTimeUniforms.d.ts +6 -0
- package/dist/components/Studio/domain/useStudioShaderTimeUniforms.js +48 -0
- package/dist/components/Studio/domain/useStudioShaderViewportUniforms.d.ts +6 -0
- package/dist/components/Studio/domain/useStudioShaderViewportUniforms.js +48 -0
- package/dist/components/Studio/domain/viroNodeFactory.d.ts +28 -0
- package/dist/components/Studio/domain/viroNodeFactory.js +193 -0
- package/dist/components/Studio/index.d.ts +3 -0
- package/dist/components/Studio/index.js +7 -0
- package/dist/components/Studio/types.d.ts +149 -0
- package/dist/components/Studio/types.js +4 -0
- package/dist/components/Types/ViroEvents.d.ts +49 -1
- package/dist/components/Types/ViroEvents.js +1 -0
- package/dist/components/Utilities/VRModuleOpenXR.d.ts +32 -0
- package/dist/components/Utilities/VRModuleOpenXR.js +44 -0
- package/dist/components/Utilities/VRQuestNavigatorBridge.d.ts +85 -0
- package/dist/components/Utilities/VRQuestNavigatorBridge.js +124 -0
- package/dist/components/Utilities/ViroPlatform.d.ts +10 -0
- package/dist/components/Utilities/ViroPlatform.js +43 -0
- package/dist/components/Utilities/ViroUtils.d.ts +19 -0
- package/dist/components/Utilities/ViroUtils.js +34 -0
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/components/Utilities/useAnySourceHover.d.ts +36 -0
- package/dist/components/Utilities/useAnySourceHover.js +48 -0
- package/dist/components/Utilities/useAnySourcePressed.d.ts +37 -0
- package/dist/components/Utilities/useAnySourcePressed.js +61 -0
- package/dist/components/Viro360Image.d.ts +7 -0
- package/dist/components/ViroQuestEntryPoint.d.ts +13 -0
- package/dist/components/ViroQuestEntryPoint.js +104 -0
- package/dist/components/ViroVRSceneNavigator.d.ts +24 -10
- package/dist/components/ViroVRSceneNavigator.js +21 -18
- package/dist/components/ViroXRSceneNavigator.d.ts +54 -0
- package/dist/components/ViroXRSceneNavigator.js +173 -0
- package/dist/components/VisionOS/ViroVisionOSModule.d.ts +65 -0
- package/dist/components/VisionOS/ViroVisionOSModule.js +91 -0
- package/dist/index.d.ts +16 -3
- package/dist/index.js +34 -2
- package/dist/plugins/withViro.d.ts +28 -1
- package/dist/plugins/withViroAndroid.js +312 -7
- package/dist/plugins/withViroIos.js +17 -8
- package/dist/plugins/withViroVisionOS.d.ts +24 -0
- package/dist/plugins/withViroVisionOS.js +265 -0
- package/index.ts +66 -0
- package/ios/ViroReact.podspec +15 -5
- package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreCoreMLSemanticsResources.bundle/Info.plist +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/ARCoreResources.bundle/Info.plist +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSession.h +30 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +16 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGLTFLoader.h +34 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROInputControllerBase.h +74 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROInputType.h +11 -3
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROMaterial.h +29 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROMorpher.h +4 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPlatformUtil.h +13 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPortal.h +17 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderContext.h +41 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderer.h +23 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROSemantics.h +14 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROViewAR.h +11 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Shaders.dat +1 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/ViroKit +0 -0
- package/ios/dist/ViroRenderer/ViroKit.podspec +5 -0
- package/ios/dist/include/VRT360Image.h +1 -0
- package/ios/dist/include/VRTARSceneNavigator.h +7 -0
- package/ios/dist/include/VRTStudioModule.h +6 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +8 -8
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ViroXRSceneNavigator = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
39
|
+
const ViroARSceneNavigator_1 = require("./AR/ViroARSceneNavigator");
|
|
40
|
+
const ViroPlatform_1 = require("./Utilities/ViroPlatform");
|
|
41
|
+
const VRQuestNavigatorBridge_1 = require("./Utilities/VRQuestNavigatorBridge");
|
|
42
|
+
const VRLauncher = react_native_1.NativeModules.VRLauncher;
|
|
43
|
+
// Quest VR requires a lifecycle-correct VRActivity that drives
|
|
44
|
+
// ReactHostImpl.onHostResume(VRActivity) on entry. The skipActivityIdentity
|
|
45
|
+
// AssertionOnHostPause feature flag (used to suppress the racy MainActivity.
|
|
46
|
+
// onPause assertion when currentActivity has been promoted to VR) is only
|
|
47
|
+
// honored on RN >= 0.83. Without it, MainActivity.onPause hard-crashes via
|
|
48
|
+
// Assertions.assertCondition, so the entire VR path requires RN 0.83+.
|
|
49
|
+
// AR continues to work on RN >= 0.81 (Expo 54+) — only the Quest VR launch
|
|
50
|
+
// is gated.
|
|
51
|
+
const MIN_RN_FOR_VR = { major: 0, minor: 83 };
|
|
52
|
+
function checkRNVersionForVR() {
|
|
53
|
+
let version = "unknown";
|
|
54
|
+
try {
|
|
55
|
+
version = require("react-native/package.json").version;
|
|
56
|
+
const [maj, min] = version.split(".").map((n) => parseInt(n, 10));
|
|
57
|
+
if (Number.isFinite(maj) &&
|
|
58
|
+
Number.isFinite(min) &&
|
|
59
|
+
(maj > MIN_RN_FOR_VR.major ||
|
|
60
|
+
(maj === MIN_RN_FOR_VR.major && min >= MIN_RN_FOR_VR.minor))) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// fall through to throw with version="unknown"
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`[Viro] Meta Quest VR requires React Native >= ${MIN_RN_FOR_VR.major}.${MIN_RN_FOR_VR.minor} ` +
|
|
68
|
+
`(Expo SDK >= 55). Detected: ${version}. ` +
|
|
69
|
+
`AR features still work on this version — only ViroXRSceneNavigator's VR path on Quest is gated.`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Cross-reality scene navigator. Picks the right underlying navigator at runtime:
|
|
73
|
+
*
|
|
74
|
+
* - **iOS / non-Quest Android** → `ViroARSceneNavigator` (rendered inline)
|
|
75
|
+
* - **Meta Quest** → launches VRActivity via `VRLauncher.launchVRScene()` and
|
|
76
|
+
* forwards all navigator operations (push/pop/etc.) to the
|
|
77
|
+
* `ViroVRSceneNavigator` running there via `VRQuestNavigatorBridge`.
|
|
78
|
+
* Render output is null — VRActivity owns the display.
|
|
79
|
+
*
|
|
80
|
+
* Pass `arInitialScene` / `vrInitialScene` when the AR and VR scenes differ.
|
|
81
|
+
* When only `initialScene` is provided it is used for both modes.
|
|
82
|
+
*
|
|
83
|
+
* Renderer flags (`hdrEnabled`, `pbrEnabled`, `bloomEnabled`, `shadowsEnabled`,
|
|
84
|
+
* `passthroughEnabled`, etc.) are forwarded to ViroVRSceneNavigator on Quest
|
|
85
|
+
* via the intent bridge.
|
|
86
|
+
*/
|
|
87
|
+
exports.ViroXRSceneNavigator = React.forwardRef(function ViroXRSceneNavigator(props, ref) {
|
|
88
|
+
const { initialScene, arInitialScene, vrInitialScene,
|
|
89
|
+
// VR-only renderer config — forwarded via bridge on Quest
|
|
90
|
+
hdrEnabled, pbrEnabled, bloomEnabled, shadowsEnabled, multisamplingEnabled, vrModeEnabled, passthroughEnabled, handTrackingEnabled, onExitViro, debug, ...rest } = props;
|
|
91
|
+
// Inner ref used on the AR path to capture the ViroARSceneNavigator instance.
|
|
92
|
+
const arRef = React.useRef(null);
|
|
93
|
+
// Expose navigator interface on the ref.
|
|
94
|
+
// Quest: proxy push/pop/etc. through VRQuestNavigatorBridge to VRActivity.
|
|
95
|
+
// AR: expose the underlying ViroARSceneNavigator instance directly.
|
|
96
|
+
React.useImperativeHandle(ref, () => {
|
|
97
|
+
if (ViroPlatform_1.isQuest) {
|
|
98
|
+
const bridgeNav = {
|
|
99
|
+
push: (scene) => VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.dispatchOp({ type: "push", scene }),
|
|
100
|
+
replace: (scene) => VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.dispatchOp({ type: "replace", scene }),
|
|
101
|
+
jump: (scene) => VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.dispatchOp({ type: "jump", scene }),
|
|
102
|
+
pop: () => VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.dispatchOp({ type: "pop" }),
|
|
103
|
+
popN: (n) => VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.dispatchOp({ type: "popN", n }),
|
|
104
|
+
};
|
|
105
|
+
return { sceneNavigator: bridgeNav, arSceneNavigator: bridgeNav };
|
|
106
|
+
}
|
|
107
|
+
return arRef.current;
|
|
108
|
+
}, []);
|
|
109
|
+
// Track AppState so we can detect background → active transitions.
|
|
110
|
+
const appStateRef = React.useRef(react_native_1.AppState.currentState);
|
|
111
|
+
// Timestamp at which AppState last left "active". Lets us distinguish a
|
|
112
|
+
// genuine Quest-menu return (background lasts seconds) from racy
|
|
113
|
+
// background→active bounces caused by the dual-Activity ReactHost
|
|
114
|
+
// transitioning state (background lasts <500ms). Only the former should
|
|
115
|
+
// re-launch VR; the latter would trigger a no-op startActivity that can
|
|
116
|
+
// contribute to the lifecycle storm in some configurations.
|
|
117
|
+
const leftActiveAtRef = React.useRef(0);
|
|
118
|
+
// On Quest: register the intent (scene + renderer config) then launch VRActivity.
|
|
119
|
+
// Also re-launch when the app returns from background (e.g. Quest system menu),
|
|
120
|
+
// because VRActivity auto-finishes when MainActivity resumes.
|
|
121
|
+
React.useEffect(() => {
|
|
122
|
+
if (!ViroPlatform_1.isQuest)
|
|
123
|
+
return;
|
|
124
|
+
checkRNVersionForVR();
|
|
125
|
+
const scene = vrInitialScene ?? initialScene;
|
|
126
|
+
if (scene) {
|
|
127
|
+
VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.setIntent(scene, {
|
|
128
|
+
hdrEnabled,
|
|
129
|
+
pbrEnabled,
|
|
130
|
+
bloomEnabled,
|
|
131
|
+
shadowsEnabled,
|
|
132
|
+
multisamplingEnabled,
|
|
133
|
+
vrModeEnabled,
|
|
134
|
+
passthroughEnabled,
|
|
135
|
+
handTrackingEnabled,
|
|
136
|
+
onExitViro,
|
|
137
|
+
debug,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.setVRActive(true);
|
|
141
|
+
VRLauncher?.launchVRScene?.();
|
|
142
|
+
const sub = react_native_1.AppState.addEventListener("change", (nextState) => {
|
|
143
|
+
const prev = appStateRef.current;
|
|
144
|
+
appStateRef.current = nextState;
|
|
145
|
+
if (prev === "active" && nextState !== "active") {
|
|
146
|
+
leftActiveAtRef.current = Date.now();
|
|
147
|
+
}
|
|
148
|
+
// Re-launch VR when the app returns from being backgrounded by the system
|
|
149
|
+
// (Quest menu, home, recents). Explicit exitVRScene() clears isVRActive()
|
|
150
|
+
// before finishing VRActivity, so Activity-transition-driven background→active
|
|
151
|
+
// cycles are ignored here.
|
|
152
|
+
if (prev !== "active" && nextState === "active" && VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.isVRActive()) {
|
|
153
|
+
// Skip if we were only briefly out of "active" — that's a racy
|
|
154
|
+
// dual-Activity ReactHost bounce, not a genuine menu return.
|
|
155
|
+
const backgroundedFor = Date.now() - leftActiveAtRef.current;
|
|
156
|
+
if (leftActiveAtRef.current > 0 && backgroundedFor < 1500)
|
|
157
|
+
return;
|
|
158
|
+
VRQuestNavigatorBridge_1.VRQuestNavigatorBridge.setVRActive(true);
|
|
159
|
+
VRLauncher?.launchVRScene?.();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
return () => sub.remove();
|
|
163
|
+
}, []);
|
|
164
|
+
// Quest renders nothing here — VRActivity owns the display.
|
|
165
|
+
if (ViroPlatform_1.isQuest)
|
|
166
|
+
return null;
|
|
167
|
+
const scene = arInitialScene ?? initialScene;
|
|
168
|
+
if (!scene) {
|
|
169
|
+
console.warn("[Viro] ViroXRSceneNavigator requires `arInitialScene` or `initialScene`.");
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
return (<ViroARSceneNavigator_1.ViroARSceneNavigator ref={arRef} initialScene={scene} {...rest}/>);
|
|
173
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViroVisionOSModule
|
|
3
|
+
*
|
|
4
|
+
* JavaScript API for controlling the visionOS ImmersiveSpace.
|
|
5
|
+
* On iOS / Android the calls are no-ops (module returns false / resolves silently).
|
|
6
|
+
*
|
|
7
|
+
* ── Host-app setup required ──────────────────────────────────────────────────
|
|
8
|
+
*
|
|
9
|
+
* 1. Add the ImmersiveSpace to your SwiftUI App struct (visionOS only):
|
|
10
|
+
*
|
|
11
|
+
* #if os(visionOS)
|
|
12
|
+
* import ViroReact
|
|
13
|
+
* #endif
|
|
14
|
+
*
|
|
15
|
+
* @main struct MyApp: App {
|
|
16
|
+
* var body: some Scene {
|
|
17
|
+
* WindowGroup {
|
|
18
|
+
* ContentView()
|
|
19
|
+
* #if os(visionOS)
|
|
20
|
+
* .viroImmersiveSpaceController()
|
|
21
|
+
* #endif
|
|
22
|
+
* }
|
|
23
|
+
* #if os(visionOS)
|
|
24
|
+
* ImmersiveSpace(id: "ViroImmersive") {
|
|
25
|
+
* ViroImmersiveSpaceView()
|
|
26
|
+
* }
|
|
27
|
+
* .immersionStyle(selection: .constant(.mixed), in: .mixed, .full, .progressive)
|
|
28
|
+
* #endif
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* 2. Call from JavaScript:
|
|
33
|
+
*
|
|
34
|
+
* import { ViroVisionOSModule } from '@reactvision/react-viro';
|
|
35
|
+
*
|
|
36
|
+
* await ViroVisionOSModule.enterImmersiveSpace('mixed');
|
|
37
|
+
* // ... render Viro scene inside ImmersiveSpace ...
|
|
38
|
+
* await ViroVisionOSModule.exitImmersiveSpace();
|
|
39
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
*/
|
|
41
|
+
export type ImmersiveSpaceStyle = "mixed" | "full" | "progressive";
|
|
42
|
+
/**
|
|
43
|
+
* Returns true if the app is running on Apple Vision Pro (visionOS).
|
|
44
|
+
* Uses the native module constant; falls back to Platform.isVision when
|
|
45
|
+
* available (React Native 0.83+).
|
|
46
|
+
*/
|
|
47
|
+
export declare function isVisionOS(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Opens the Viro ImmersiveSpace on visionOS.
|
|
50
|
+
*
|
|
51
|
+
* @param style "mixed" (default) — virtual content blended over passthrough
|
|
52
|
+
* "full" — fully virtual, passthrough hidden
|
|
53
|
+
* "progressive" — graduated immersion with crown dial
|
|
54
|
+
*/
|
|
55
|
+
export declare function enterImmersiveSpace(style?: ImmersiveSpaceStyle): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Dismisses the Viro ImmersiveSpace and returns to the window layer.
|
|
58
|
+
*/
|
|
59
|
+
export declare function exitImmersiveSpace(): Promise<boolean>;
|
|
60
|
+
/** Convenience object matching the typical NativeModules pattern. */
|
|
61
|
+
export declare const ViroVisionOSModule: {
|
|
62
|
+
readonly isVisionOS: typeof isVisionOS;
|
|
63
|
+
readonly enterImmersiveSpace: typeof enterImmersiveSpace;
|
|
64
|
+
readonly exitImmersiveSpace: typeof exitImmersiveSpace;
|
|
65
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ViroVisionOSModule
|
|
4
|
+
*
|
|
5
|
+
* JavaScript API for controlling the visionOS ImmersiveSpace.
|
|
6
|
+
* On iOS / Android the calls are no-ops (module returns false / resolves silently).
|
|
7
|
+
*
|
|
8
|
+
* ── Host-app setup required ──────────────────────────────────────────────────
|
|
9
|
+
*
|
|
10
|
+
* 1. Add the ImmersiveSpace to your SwiftUI App struct (visionOS only):
|
|
11
|
+
*
|
|
12
|
+
* #if os(visionOS)
|
|
13
|
+
* import ViroReact
|
|
14
|
+
* #endif
|
|
15
|
+
*
|
|
16
|
+
* @main struct MyApp: App {
|
|
17
|
+
* var body: some Scene {
|
|
18
|
+
* WindowGroup {
|
|
19
|
+
* ContentView()
|
|
20
|
+
* #if os(visionOS)
|
|
21
|
+
* .viroImmersiveSpaceController()
|
|
22
|
+
* #endif
|
|
23
|
+
* }
|
|
24
|
+
* #if os(visionOS)
|
|
25
|
+
* ImmersiveSpace(id: "ViroImmersive") {
|
|
26
|
+
* ViroImmersiveSpaceView()
|
|
27
|
+
* }
|
|
28
|
+
* .immersionStyle(selection: .constant(.mixed), in: .mixed, .full, .progressive)
|
|
29
|
+
* #endif
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* 2. Call from JavaScript:
|
|
34
|
+
*
|
|
35
|
+
* import { ViroVisionOSModule } from '@reactvision/react-viro';
|
|
36
|
+
*
|
|
37
|
+
* await ViroVisionOSModule.enterImmersiveSpace('mixed');
|
|
38
|
+
* // ... render Viro scene inside ImmersiveSpace ...
|
|
39
|
+
* await ViroVisionOSModule.exitImmersiveSpace();
|
|
40
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
41
|
+
*/
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.ViroVisionOSModule = void 0;
|
|
44
|
+
exports.isVisionOS = isVisionOS;
|
|
45
|
+
exports.enterImmersiveSpace = enterImmersiveSpace;
|
|
46
|
+
exports.exitImmersiveSpace = exitImmersiveSpace;
|
|
47
|
+
const react_native_1 = require("react-native");
|
|
48
|
+
/** @internal — raw NativeModule reference */
|
|
49
|
+
const { VRTVisionOSModule } = react_native_1.NativeModules;
|
|
50
|
+
/**
|
|
51
|
+
* Returns true if the app is running on Apple Vision Pro (visionOS).
|
|
52
|
+
* Uses the native module constant; falls back to Platform.isVision when
|
|
53
|
+
* available (React Native 0.83+).
|
|
54
|
+
*/
|
|
55
|
+
function isVisionOS() {
|
|
56
|
+
// React Native 0.83+ exposes Platform.isVision on visionOS builds.
|
|
57
|
+
if (react_native_1.Platform.isVision === true)
|
|
58
|
+
return true;
|
|
59
|
+
// Fallback: check the native module constant.
|
|
60
|
+
return VRTVisionOSModule?.isVisionOS === true;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Opens the Viro ImmersiveSpace on visionOS.
|
|
64
|
+
*
|
|
65
|
+
* @param style "mixed" (default) — virtual content blended over passthrough
|
|
66
|
+
* "full" — fully virtual, passthrough hidden
|
|
67
|
+
* "progressive" — graduated immersion with crown dial
|
|
68
|
+
*/
|
|
69
|
+
async function enterImmersiveSpace(style = "mixed") {
|
|
70
|
+
if (!VRTVisionOSModule) {
|
|
71
|
+
if (__DEV__) {
|
|
72
|
+
console.warn("[Viro] VRTVisionOSModule not available on this platform");
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return VRTVisionOSModule.enterImmersiveSpace(style);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Dismisses the Viro ImmersiveSpace and returns to the window layer.
|
|
80
|
+
*/
|
|
81
|
+
async function exitImmersiveSpace() {
|
|
82
|
+
if (!VRTVisionOSModule)
|
|
83
|
+
return false;
|
|
84
|
+
return VRTVisionOSModule.exitImmersiveSpace();
|
|
85
|
+
}
|
|
86
|
+
/** Convenience object matching the typical NativeModules pattern. */
|
|
87
|
+
exports.ViroVisionOSModule = {
|
|
88
|
+
isVisionOS,
|
|
89
|
+
enterImmersiveSpace,
|
|
90
|
+
exitImmersiveSpace,
|
|
91
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
import { ViroAnimations } from "./components/Animation/ViroAnimations";
|
|
7
|
+
import { StudioSceneNavigator, StudioARScene } from "./components/Studio";
|
|
8
|
+
import { ViroVisionOSModule, isVisionOS, enterImmersiveSpace, exitImmersiveSpace } from "./components/VisionOS/ViroVisionOSModule";
|
|
7
9
|
import { Viro3DObject } from "./components/Viro3DObject";
|
|
8
10
|
import { Viro360Image } from "./components/Viro360Image";
|
|
9
11
|
import { Viro360Video } from "./components/Viro360Video";
|
|
@@ -49,13 +51,24 @@ import { ViroSpotLight } from "./components/ViroSpotLight";
|
|
|
49
51
|
import { ViroText } from "./components/ViroText";
|
|
50
52
|
import { ViroVideo } from "./components/ViroVideo";
|
|
51
53
|
import { ViroVRSceneNavigator } from "./components/ViroVRSceneNavigator";
|
|
54
|
+
import { ViroXRSceneNavigator } from "./components/ViroXRSceneNavigator";
|
|
52
55
|
import { Viro3DSceneNavigator } from "./components/Viro3DSceneNavigator";
|
|
56
|
+
import { hasOpenXRSupport, isQuest } from "./components/Utilities/ViroPlatform";
|
|
57
|
+
import { useAnySourceHover } from "./components/Utilities/useAnySourceHover";
|
|
58
|
+
import { useAnySourcePressed } from "./components/Utilities/useAnySourcePressed";
|
|
53
59
|
import { ViroTextStyle } from "./components/Styles/ViroTextStyle";
|
|
54
60
|
import { ViroStyle } from "./components/Styles/ViroStyle";
|
|
55
|
-
import { polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, ViroARSupportResponse, latLngToMercator, gpsToArWorld } from "./components/Utilities/ViroUtils";
|
|
61
|
+
import { polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, latLngToMercator, gpsToArWorld } from "./components/Utilities/ViroUtils";
|
|
56
62
|
import { ViroARCamera } from "./components/AR/ViroARCamera";
|
|
57
|
-
import { ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroRotateEvent, 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, ViroPinchStateTypes, ViroClickStateTypes, ViroRotateStateTypes, ViroProvider, ViroCloudAnchorState, ViroCloudAnchorProvider, ViroCloudAnchor, ViroHostCloudAnchorResult, ViroResolveCloudAnchorResult, ViroCloudAnchorStateChangeEvent, ViroGeospatialAnchorProvider, ViroEarthTrackingState, ViroVPSAvailability, ViroGeospatialAnchorType, ViroQuaternion, ViroGeospatialPose, ViroGeospatialAnchor, ViroGeospatialSupportResult, ViroEarthTrackingStateResult, ViroGeospatialPoseResult, ViroVPSAvailabilityResult, ViroCreateGeospatialAnchorResult, ViroMonocularDepthSupportResult, ViroMonocularDepthModelAvailableResult, ViroMonocularDepthPreferenceResult } from "./components/Types/ViroEvents";
|
|
63
|
+
import { ViroHoverEvent, ViroClickEvent, ViroClickStateEvent, ViroTouchEvent, ViroScrollEvent, ViroSwipeEvent, ViroFuseEvent, ViroPinchEvent, ViroRotateEvent, 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, ViroPinchStateTypes, ViroClickStateTypes, ViroRotateStateTypes, 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 } from "./components/Types/ViroEvents";
|
|
58
64
|
import { ViroSurface } from "./components/ViroSurface";
|
|
59
65
|
import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
|
|
60
66
|
import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
|
|
61
|
-
|
|
67
|
+
import { ViroQuestEntryPoint } from "./components/ViroQuestEntryPoint";
|
|
68
|
+
import { VRQuestNavigatorBridge } from "./components/Utilities/VRQuestNavigatorBridge";
|
|
69
|
+
import { VRModuleOpenXR, useVRViewTag, exitVRScene } from "./components/Utilities/VRModuleOpenXR";
|
|
70
|
+
import type { VRModuleOpenXRType } from "./components/Utilities/VRModuleOpenXR";
|
|
71
|
+
export { ViroARImageMarker, ViroARObjectMarker, ViroARTrackingTargets, ViroARPlane, ViroARPlaneSelector, ViroARScene, ViroARSceneNavigator, ViroBox, ViroButton, ViroCamera, ViroController, ViroDirectionalLight, ViroFlexView, ViroGeometry, ViroLightingEnvironment, ViroImage, ViroMaterials, ViroARCamera, ViroMaterialVideo, 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, 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, };
|
|
72
|
+
export type { VRModuleOpenXRType };
|
|
73
|
+
export type { ImmersiveSpaceStyle } from "./components/VisionOS/ViroVisionOSModule";
|
|
74
|
+
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
|
-
exports.
|
|
4
|
-
exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = void 0;
|
|
3
|
+
exports.ViroQuestEntryPoint = exports.ViroXRSceneNavigator = exports.ViroVRSceneNavigator = exports.ViroVideo = exports.ViroText = exports.ViroSpotLight = exports.ViroSpinner = exports.ViroSphere = exports.ViroSpatialSound = 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.ViroMaterialVideo = exports.ViroARCamera = exports.ViroMaterials = exports.ViroImage = exports.ViroLightingEnvironment = exports.ViroGeometry = exports.ViroFlexView = exports.ViroDirectionalLight = 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.Viro3DSceneNavigator = exports.exitVRScene = exports.useVRViewTag = exports.VRModuleOpenXR = exports.VRQuestNavigatorBridge = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* Copyright (c) 2016-present, Viro Media, Inc.
|
|
7
7
|
* All rights reserved.
|
|
@@ -9,6 +9,14 @@ exports.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateType
|
|
|
9
9
|
*/
|
|
10
10
|
const ViroAnimations_1 = require("./components/Animation/ViroAnimations");
|
|
11
11
|
Object.defineProperty(exports, "ViroAnimations", { enumerable: true, get: function () { return ViroAnimations_1.ViroAnimations; } });
|
|
12
|
+
const Studio_1 = require("./components/Studio");
|
|
13
|
+
Object.defineProperty(exports, "StudioSceneNavigator", { enumerable: true, get: function () { return Studio_1.StudioSceneNavigator; } });
|
|
14
|
+
Object.defineProperty(exports, "StudioARScene", { enumerable: true, get: function () { return Studio_1.StudioARScene; } });
|
|
15
|
+
const ViroVisionOSModule_1 = require("./components/VisionOS/ViroVisionOSModule");
|
|
16
|
+
Object.defineProperty(exports, "ViroVisionOSModule", { enumerable: true, get: function () { return ViroVisionOSModule_1.ViroVisionOSModule; } });
|
|
17
|
+
Object.defineProperty(exports, "isVisionOS", { enumerable: true, get: function () { return ViroVisionOSModule_1.isVisionOS; } });
|
|
18
|
+
Object.defineProperty(exports, "enterImmersiveSpace", { enumerable: true, get: function () { return ViroVisionOSModule_1.enterImmersiveSpace; } });
|
|
19
|
+
Object.defineProperty(exports, "exitImmersiveSpace", { enumerable: true, get: function () { return ViroVisionOSModule_1.exitImmersiveSpace; } });
|
|
12
20
|
const Viro3DObject_1 = require("./components/Viro3DObject");
|
|
13
21
|
Object.defineProperty(exports, "Viro3DObject", { enumerable: true, get: function () { return Viro3DObject_1.Viro3DObject; } });
|
|
14
22
|
const Viro360Image_1 = require("./components/Viro360Image");
|
|
@@ -101,12 +109,23 @@ const ViroVideo_1 = require("./components/ViroVideo");
|
|
|
101
109
|
Object.defineProperty(exports, "ViroVideo", { enumerable: true, get: function () { return ViroVideo_1.ViroVideo; } });
|
|
102
110
|
const ViroVRSceneNavigator_1 = require("./components/ViroVRSceneNavigator");
|
|
103
111
|
Object.defineProperty(exports, "ViroVRSceneNavigator", { enumerable: true, get: function () { return ViroVRSceneNavigator_1.ViroVRSceneNavigator; } });
|
|
112
|
+
const ViroXRSceneNavigator_1 = require("./components/ViroXRSceneNavigator");
|
|
113
|
+
Object.defineProperty(exports, "ViroXRSceneNavigator", { enumerable: true, get: function () { return ViroXRSceneNavigator_1.ViroXRSceneNavigator; } });
|
|
104
114
|
const Viro3DSceneNavigator_1 = require("./components/Viro3DSceneNavigator");
|
|
105
115
|
Object.defineProperty(exports, "Viro3DSceneNavigator", { enumerable: true, get: function () { return Viro3DSceneNavigator_1.Viro3DSceneNavigator; } });
|
|
116
|
+
const ViroPlatform_1 = require("./components/Utilities/ViroPlatform");
|
|
117
|
+
Object.defineProperty(exports, "hasOpenXRSupport", { enumerable: true, get: function () { return ViroPlatform_1.hasOpenXRSupport; } });
|
|
118
|
+
Object.defineProperty(exports, "isQuest", { enumerable: true, get: function () { return ViroPlatform_1.isQuest; } });
|
|
119
|
+
const useAnySourceHover_1 = require("./components/Utilities/useAnySourceHover");
|
|
120
|
+
Object.defineProperty(exports, "useAnySourceHover", { enumerable: true, get: function () { return useAnySourceHover_1.useAnySourceHover; } });
|
|
121
|
+
const useAnySourcePressed_1 = require("./components/Utilities/useAnySourcePressed");
|
|
122
|
+
Object.defineProperty(exports, "useAnySourcePressed", { enumerable: true, get: function () { return useAnySourcePressed_1.useAnySourcePressed; } });
|
|
106
123
|
const ViroUtils_1 = require("./components/Utilities/ViroUtils");
|
|
107
124
|
Object.defineProperty(exports, "polarToCartesian", { enumerable: true, get: function () { return ViroUtils_1.polarToCartesian; } });
|
|
108
125
|
Object.defineProperty(exports, "polarToCartesianActual", { enumerable: true, get: function () { return ViroUtils_1.polarToCartesianActual; } });
|
|
109
126
|
Object.defineProperty(exports, "isARSupportedOnDevice", { enumerable: true, get: function () { return ViroUtils_1.isARSupportedOnDevice; } });
|
|
127
|
+
Object.defineProperty(exports, "requestRequiredPermissions", { enumerable: true, get: function () { return ViroUtils_1.requestRequiredPermissions; } });
|
|
128
|
+
Object.defineProperty(exports, "checkPermissions", { enumerable: true, get: function () { return ViroUtils_1.checkPermissions; } });
|
|
110
129
|
Object.defineProperty(exports, "latLngToMercator", { enumerable: true, get: function () { return ViroUtils_1.latLngToMercator; } });
|
|
111
130
|
Object.defineProperty(exports, "gpsToArWorld", { enumerable: true, get: function () { return ViroUtils_1.gpsToArWorld; } });
|
|
112
131
|
const ViroARCamera_1 = require("./components/AR/ViroARCamera");
|
|
@@ -121,3 +140,16 @@ const ViroSceneNavigator_1 = require("./components/ViroSceneNavigator");
|
|
|
121
140
|
Object.defineProperty(exports, "ViroSceneNavigator", { enumerable: true, get: function () { return ViroSceneNavigator_1.ViroSceneNavigator; } });
|
|
122
141
|
const ViroVersion_1 = require("./components/Utilities/ViroVersion");
|
|
123
142
|
Object.defineProperty(exports, "VIRO_VERSION", { enumerable: true, get: function () { return ViroVersion_1.VIRO_VERSION; } });
|
|
143
|
+
const ViroQuestEntryPoint_1 = require("./components/ViroQuestEntryPoint");
|
|
144
|
+
Object.defineProperty(exports, "ViroQuestEntryPoint", { enumerable: true, get: function () { return ViroQuestEntryPoint_1.ViroQuestEntryPoint; } });
|
|
145
|
+
const VRQuestNavigatorBridge_1 = require("./components/Utilities/VRQuestNavigatorBridge");
|
|
146
|
+
Object.defineProperty(exports, "VRQuestNavigatorBridge", { enumerable: true, get: function () { return VRQuestNavigatorBridge_1.VRQuestNavigatorBridge; } });
|
|
147
|
+
const VRModuleOpenXR_1 = require("./components/Utilities/VRModuleOpenXR");
|
|
148
|
+
Object.defineProperty(exports, "VRModuleOpenXR", { enumerable: true, get: function () { return VRModuleOpenXR_1.VRModuleOpenXR; } });
|
|
149
|
+
Object.defineProperty(exports, "useVRViewTag", { enumerable: true, get: function () { return VRModuleOpenXR_1.useVRViewTag; } });
|
|
150
|
+
Object.defineProperty(exports, "exitVRScene", { enumerable: true, get: function () { return VRModuleOpenXR_1.exitVRScene; } });
|
|
151
|
+
const react_native_1 = require("react-native");
|
|
152
|
+
// Auto-register the Quest VR entry point. VRActivity launches this component
|
|
153
|
+
// as 'VRQuestScene'. Registering here means apps need no manual setup.
|
|
154
|
+
// Apps that need a custom VR root can re-register after importing this package.
|
|
155
|
+
react_native_1.AppRegistry.registerComponent("VRQuestScene", () => ViroQuestEntryPoint_1.ViroQuestEntryPoint);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
-
export type XrMode = "GVR" | "AR" | "OVR_MOBILE";
|
|
2
|
+
export type XrMode = "GVR" | "AR" | "OVR_MOBILE" | "QUEST";
|
|
3
3
|
/**
|
|
4
4
|
* Anchor provider type.
|
|
5
5
|
* - "none": Disabled
|
|
@@ -55,6 +55,13 @@ export interface ViroConfigurationOptions {
|
|
|
55
55
|
* Written to AndroidManifest as com.reactvision.RVProjectId and to Info.plist as RVProjectId.
|
|
56
56
|
*/
|
|
57
57
|
rvProjectId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Override the ReactVision platform base URL.
|
|
60
|
+
* Omit for production. Set to a staging URL for testing.
|
|
61
|
+
*
|
|
62
|
+
* Written to AndroidManifest as com.reactvision.RVEndpoint and to Info.plist as RVEndpoint.
|
|
63
|
+
*/
|
|
64
|
+
rvEndpoint?: string;
|
|
58
65
|
/**
|
|
59
66
|
* Anchor provider for both cloud anchors and geospatial anchors.
|
|
60
67
|
* Replaces the deprecated cloudAnchorProvider + geospatialAnchorProvider props.
|
|
@@ -118,9 +125,29 @@ export interface ViroConfigurationOptions {
|
|
|
118
125
|
* DEFAULTS TO: false (unless provider is "arcore")
|
|
119
126
|
*/
|
|
120
127
|
includeARCore?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether to include the ARCore/Semantics pod for scene semantic segmentation.
|
|
130
|
+
* When true, adds the ARCore/Semantics pod (and ARCore/CloudAnchors as a base dependency)
|
|
131
|
+
* without enabling cloud anchors or geospatial features.
|
|
132
|
+
*
|
|
133
|
+
* Use this when you want semantic masking (ViroMaterial.semanticMask) but do NOT need
|
|
134
|
+
* cloud anchors or geospatial anchors. If includeARCore is already true, this has no effect.
|
|
135
|
+
*
|
|
136
|
+
* DEFAULTS TO: false
|
|
137
|
+
*/
|
|
138
|
+
includeSemantics?: boolean;
|
|
121
139
|
};
|
|
122
140
|
android?: {
|
|
123
141
|
xRMode?: XrMode[];
|
|
142
|
+
/**
|
|
143
|
+
* Meta Developer Portal App ID (numeric string).
|
|
144
|
+
* Written to AndroidManifest as com.oculus.app_id meta-data.
|
|
145
|
+
* Eliminates the "App Name Unavailable" popup on Meta Quest.
|
|
146
|
+
*
|
|
147
|
+
* Get your App ID from the Meta Developer Portal:
|
|
148
|
+
* https://developer.oculus.com/manage
|
|
149
|
+
*/
|
|
150
|
+
questAppId?: string;
|
|
124
151
|
};
|
|
125
152
|
}
|
|
126
153
|
/**
|