@reactvision/react-viro 2.54.0 → 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 +54 -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/ViroVersion.ts +1 -1
- package/components/Utilities/useAnySourceHover.ts +55 -0
- package/components/Utilities/useAnySourcePressed.ts +70 -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 +13 -0
- package/dist/components/AR/ViroARSceneNavigator.js +36 -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/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/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 +15 -2
- package/dist/index.js +32 -2
- package/dist/plugins/withViro.d.ts +17 -1
- package/dist/plugins/withViroAndroid.js +312 -7
- package/dist/plugins/withViroIos.js +5 -0
- package/dist/plugins/withViroVisionOS.d.ts +24 -0
- package/dist/plugins/withViroVisionOS.js +265 -0
- package/index.ts +58 -0
- package/ios/ViroReact.podspec +13 -4
- 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 +10 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +4 -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/VROPlatformUtil.h +13 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderer.h +8 -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/VRTARSceneNavigator.h +3 -0
- package/ios/dist/include/VRTStudioModule.h +6 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import { NativeSyntheticEvent, ViewProps } from "react-native";
|
|
14
|
-
import { ViroExitViroEvent } from "./Types/ViroEvents";
|
|
14
|
+
import { ViroExitViroEvent, ViroHandUpdateEvent } from "./Types/ViroEvents";
|
|
15
15
|
import { Viro3DPoint, ViroNativeRef, ViroScene, ViroSceneDictionary } from "./Types/ViroUtils";
|
|
16
16
|
type State = {
|
|
17
17
|
sceneDictionary: ViroSceneDictionary;
|
|
@@ -54,9 +54,23 @@ type Props = ViewProps & {
|
|
|
54
54
|
bloomEnabled?: boolean;
|
|
55
55
|
shadowsEnabled?: boolean;
|
|
56
56
|
multisamplingEnabled?: boolean;
|
|
57
|
+
/** Enable XR_FB_passthrough mixed-reality camera feed (Quest 3 / Quest Pro). */
|
|
58
|
+
passthroughEnabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Enable skeletal hand tracking (Quest — requires com.oculus.permission.HAND_TRACKING in manifest).
|
|
61
|
+
* Pinch and grab gestures fire the same onClick/onDrag events as controller buttons.
|
|
62
|
+
*/
|
|
63
|
+
handTrackingEnabled?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Per-frame skeletal hand joint data. Fires at display refresh rate (72/90 Hz).
|
|
66
|
+
* null for a hand means it is not currently tracked.
|
|
67
|
+
*/
|
|
68
|
+
onHandUpdate?: (event: NativeSyntheticEvent<ViroHandUpdateEvent>) => void;
|
|
57
69
|
};
|
|
58
70
|
/**
|
|
59
71
|
* ViroVRSceneNavigator is used to transition between multiple scenes.
|
|
72
|
+
* Intended for OVR / Google Cardboard VR mode on non-Quest Android devices.
|
|
73
|
+
* On Meta Quest use ViroXRSceneNavigator instead.
|
|
60
74
|
*/
|
|
61
75
|
export declare class ViroVRSceneNavigator extends React.Component<Props, State> {
|
|
62
76
|
_component: ViroNativeRef;
|
|
@@ -64,7 +78,7 @@ export declare class ViroVRSceneNavigator extends React.Component<Props, State>
|
|
|
64
78
|
* Called from native when either the user physically decides to exit vr (hits
|
|
65
79
|
* the "X" buton).
|
|
66
80
|
*/
|
|
67
|
-
_onExitViro(_event: NativeSyntheticEvent<ViroExitViroEvent>)
|
|
81
|
+
_onExitViro: (_event: NativeSyntheticEvent<ViroExitViroEvent>) => void;
|
|
68
82
|
constructor(props: Props);
|
|
69
83
|
getRandomTag(): string;
|
|
70
84
|
/**
|
|
@@ -81,7 +95,7 @@ export declare class ViroVRSceneNavigator extends React.Component<Props, State>
|
|
|
81
95
|
*
|
|
82
96
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
83
97
|
*/
|
|
84
|
-
push(param1?: ViroScene | string, param2?: ViroScene)
|
|
98
|
+
push: (param1?: ViroScene | string, param2?: ViroScene) => void;
|
|
85
99
|
/**
|
|
86
100
|
* Replace the top scene in the stack with the given scene. The remainder of the back
|
|
87
101
|
* history is kept in the same order as before.
|
|
@@ -93,7 +107,7 @@ export declare class ViroVRSceneNavigator extends React.Component<Props, State>
|
|
|
93
107
|
*
|
|
94
108
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
95
109
|
*/
|
|
96
|
-
replace(param1?: ViroScene | string, param2?: ViroScene)
|
|
110
|
+
replace: (param1?: ViroScene | string, param2?: ViroScene) => void;
|
|
97
111
|
/**
|
|
98
112
|
* Jumps to a given scene that had been previously pushed. If the scene was not pushed, we
|
|
99
113
|
* then push and jump to it. The back history is re-ordered such that jumped to scenes are
|
|
@@ -106,9 +120,9 @@ export declare class ViroVRSceneNavigator extends React.Component<Props, State>
|
|
|
106
120
|
*
|
|
107
121
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
108
122
|
*/
|
|
109
|
-
jump(param1?: ViroScene | string, param2?: ViroScene)
|
|
110
|
-
pop()
|
|
111
|
-
popN(n: number)
|
|
123
|
+
jump: (param1?: ViroScene | string, param2?: ViroScene) => void;
|
|
124
|
+
pop: () => void;
|
|
125
|
+
popN: (n: number) => void;
|
|
112
126
|
/**
|
|
113
127
|
* Increments the reference count for a scene within sceneDictionary that is
|
|
114
128
|
* mapped to the given sceneKey. If no scenes are found / mapped, we create
|
|
@@ -136,9 +150,9 @@ export declare class ViroVRSceneNavigator extends React.Component<Props, State>
|
|
|
136
150
|
reorderHistory(sceneKey: string): void;
|
|
137
151
|
popHistoryByN(n: number): void;
|
|
138
152
|
getSceneIndex(sceneTag: string): number;
|
|
139
|
-
_recenterTracking()
|
|
140
|
-
_project(point: Viro3DPoint)
|
|
141
|
-
_unproject(point: Viro3DPoint)
|
|
153
|
+
_recenterTracking: () => void;
|
|
154
|
+
_project: (point: Viro3DPoint) => Promise<any>;
|
|
155
|
+
_unproject: (point: Viro3DPoint) => Promise<any>;
|
|
142
156
|
_renderSceneStackItems(): React.JSX.Element[];
|
|
143
157
|
sceneNavigator: {
|
|
144
158
|
push: (param1?: ViroScene | string, param2?: ViroScene) => void;
|
|
@@ -48,9 +48,12 @@ exports.ViroVRSceneNavigator = void 0;
|
|
|
48
48
|
const React = __importStar(require("react"));
|
|
49
49
|
const react_native_1 = require("react-native");
|
|
50
50
|
const ViroSceneNavigatorModule = react_native_1.NativeModules.VRTSceneNavigatorModule;
|
|
51
|
+
const VRModuleOpenXR = react_native_1.NativeModules.VRModuleOpenXR;
|
|
51
52
|
var mathRandomOffset = 0;
|
|
52
53
|
/**
|
|
53
54
|
* ViroVRSceneNavigator is used to transition between multiple scenes.
|
|
55
|
+
* Intended for OVR / Google Cardboard VR mode on non-Quest Android devices.
|
|
56
|
+
* On Meta Quest use ViroXRSceneNavigator instead.
|
|
54
57
|
*/
|
|
55
58
|
class ViroVRSceneNavigator extends React.Component {
|
|
56
59
|
_component = null;
|
|
@@ -58,9 +61,9 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
58
61
|
* Called from native when either the user physically decides to exit vr (hits
|
|
59
62
|
* the "X" buton).
|
|
60
63
|
*/
|
|
61
|
-
_onExitViro(_event) {
|
|
64
|
+
_onExitViro = (_event) => {
|
|
62
65
|
this.props.onExitViro && this.props.onExitViro();
|
|
63
|
-
}
|
|
66
|
+
};
|
|
64
67
|
constructor(props) {
|
|
65
68
|
super(props);
|
|
66
69
|
let initialSceneTag = props.initialSceneKey;
|
|
@@ -99,7 +102,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
99
102
|
*
|
|
100
103
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
101
104
|
*/
|
|
102
|
-
push(param1, param2) {
|
|
105
|
+
push = (param1, param2) => {
|
|
103
106
|
var sceneKey = undefined;
|
|
104
107
|
var scene = undefined;
|
|
105
108
|
if (typeof param1 == "string") {
|
|
@@ -125,7 +128,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
125
128
|
}
|
|
126
129
|
this.incrementSceneReference(scene, sceneKey, false);
|
|
127
130
|
this.addToHistory(sceneKey);
|
|
128
|
-
}
|
|
131
|
+
};
|
|
129
132
|
/**
|
|
130
133
|
* Replace the top scene in the stack with the given scene. The remainder of the back
|
|
131
134
|
* history is kept in the same order as before.
|
|
@@ -137,7 +140,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
137
140
|
*
|
|
138
141
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
139
142
|
*/
|
|
140
|
-
replace(param1, param2) {
|
|
143
|
+
replace = (param1, param2) => {
|
|
141
144
|
var sceneKey = undefined;
|
|
142
145
|
var scene = undefined;
|
|
143
146
|
if (typeof param1 == "string") {
|
|
@@ -167,7 +170,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
167
170
|
this.popHistoryByN(1);
|
|
168
171
|
this.incrementSceneReference(scene, sceneKey, false);
|
|
169
172
|
this.addToHistory(sceneKey);
|
|
170
|
-
}
|
|
173
|
+
};
|
|
171
174
|
/**
|
|
172
175
|
* Jumps to a given scene that had been previously pushed. If the scene was not pushed, we
|
|
173
176
|
* then push and jump to it. The back history is re-ordered such that jumped to scenes are
|
|
@@ -180,7 +183,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
180
183
|
*
|
|
181
184
|
* @todo: use Typescript function overloading rather than this inaccurate solution
|
|
182
185
|
*/
|
|
183
|
-
jump(param1, param2) {
|
|
186
|
+
jump = (param1, param2) => {
|
|
184
187
|
var sceneKey = undefined;
|
|
185
188
|
var scene = undefined;
|
|
186
189
|
if (typeof param1 == "string") {
|
|
@@ -206,11 +209,11 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
206
209
|
}
|
|
207
210
|
this.incrementSceneReference(scene, sceneKey, true);
|
|
208
211
|
this.reorderHistory(sceneKey);
|
|
209
|
-
}
|
|
210
|
-
pop() {
|
|
212
|
+
};
|
|
213
|
+
pop = () => {
|
|
211
214
|
this.popN(1);
|
|
212
|
-
}
|
|
213
|
-
popN(n) {
|
|
215
|
+
};
|
|
216
|
+
popN = (n) => {
|
|
214
217
|
if (n === 0) {
|
|
215
218
|
return;
|
|
216
219
|
}
|
|
@@ -220,7 +223,7 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
220
223
|
}
|
|
221
224
|
this.decrementReferenceForLastNScenes(n);
|
|
222
225
|
this.popHistoryByN(n);
|
|
223
|
-
}
|
|
226
|
+
};
|
|
224
227
|
/**
|
|
225
228
|
* Increments the reference count for a scene within sceneDictionary that is
|
|
226
229
|
* mapped to the given sceneKey. If no scenes are found / mapped, we create
|
|
@@ -335,15 +338,15 @@ class ViroVRSceneNavigator extends React.Component {
|
|
|
335
338
|
// Unable to find the given sceneTag, return -1
|
|
336
339
|
return -1;
|
|
337
340
|
}
|
|
338
|
-
_recenterTracking() {
|
|
341
|
+
_recenterTracking = () => {
|
|
339
342
|
ViroSceneNavigatorModule.recenterTracking((0, react_native_1.findNodeHandle)(this));
|
|
340
|
-
}
|
|
341
|
-
async
|
|
343
|
+
};
|
|
344
|
+
_project = async (point) => {
|
|
342
345
|
return await ViroSceneNavigatorModule.project((0, react_native_1.findNodeHandle)(this), point);
|
|
343
|
-
}
|
|
344
|
-
async
|
|
346
|
+
};
|
|
347
|
+
_unproject = async (point) => {
|
|
345
348
|
return await ViroSceneNavigatorModule.unproject((0, react_native_1.findNodeHandle)(this), point);
|
|
346
|
-
}
|
|
349
|
+
};
|
|
347
350
|
_renderSceneStackItems() {
|
|
348
351
|
let views = [];
|
|
349
352
|
var i = 0;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ViewProps } from "react-native";
|
|
3
|
+
type SceneFactory = {
|
|
4
|
+
scene: () => React.JSX.Element;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Cross-reality scene navigator. Picks the right underlying navigator at runtime:
|
|
8
|
+
*
|
|
9
|
+
* - **iOS / non-Quest Android** → `ViroARSceneNavigator` (rendered inline)
|
|
10
|
+
* - **Meta Quest** → launches VRActivity via `VRLauncher.launchVRScene()` and
|
|
11
|
+
* forwards all navigator operations (push/pop/etc.) to the
|
|
12
|
+
* `ViroVRSceneNavigator` running there via `VRQuestNavigatorBridge`.
|
|
13
|
+
* Render output is null — VRActivity owns the display.
|
|
14
|
+
*
|
|
15
|
+
* Pass `arInitialScene` / `vrInitialScene` when the AR and VR scenes differ.
|
|
16
|
+
* When only `initialScene` is provided it is used for both modes.
|
|
17
|
+
*
|
|
18
|
+
* Renderer flags (`hdrEnabled`, `pbrEnabled`, `bloomEnabled`, `shadowsEnabled`,
|
|
19
|
+
* `passthroughEnabled`, etc.) are forwarded to ViroVRSceneNavigator on Quest
|
|
20
|
+
* via the intent bridge.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ViroXRSceneNavigator: React.ForwardRefExoticComponent<ViewProps & {
|
|
23
|
+
/**
|
|
24
|
+
* Scene used on both AR and VR platforms when no platform-specific scene is provided.
|
|
25
|
+
* Most apps want a different scene per platform — pass `arInitialScene` and
|
|
26
|
+
* `vrInitialScene` instead in that case.
|
|
27
|
+
*/
|
|
28
|
+
initialScene?: SceneFactory;
|
|
29
|
+
/** Scene mounted on iOS / non-Quest Android (rendered via ViroARSceneNavigator). */
|
|
30
|
+
arInitialScene?: SceneFactory;
|
|
31
|
+
/**
|
|
32
|
+
* Scene mounted on Meta Quest (rendered via ViroVRSceneNavigator in VRActivity).
|
|
33
|
+
* On Quest, this scene is forwarded to VRActivity via VRQuestNavigatorBridge
|
|
34
|
+
* rather than rendered inline, because OpenXR exclusive display requires the
|
|
35
|
+
* VR intent category on the host Activity.
|
|
36
|
+
*/
|
|
37
|
+
vrInitialScene?: SceneFactory;
|
|
38
|
+
worldAlignment?: "Gravity" | "GravityAndHeading" | "Camera";
|
|
39
|
+
autofocus?: boolean;
|
|
40
|
+
videoQuality?: "High" | "Low";
|
|
41
|
+
numberOfTrackedImages?: number;
|
|
42
|
+
vrModeEnabled?: boolean;
|
|
43
|
+
passthroughEnabled?: boolean;
|
|
44
|
+
handTrackingEnabled?: boolean;
|
|
45
|
+
onExitViro?: () => void;
|
|
46
|
+
viroAppProps?: any;
|
|
47
|
+
hdrEnabled?: boolean;
|
|
48
|
+
pbrEnabled?: boolean;
|
|
49
|
+
bloomEnabled?: boolean;
|
|
50
|
+
shadowsEnabled?: boolean;
|
|
51
|
+
multisamplingEnabled?: boolean;
|
|
52
|
+
debug?: boolean;
|
|
53
|
+
} & React.RefAttributes<unknown>>;
|
|
54
|
+
export {};
|
|
@@ -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
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";
|