@reactvision/react-viro 2.53.0 → 2.54.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/android/react_viro/react_viro-release.aar +0 -0
- package/android/viro_renderer/viro_renderer-release.aar +0 -0
- package/components/AR/ViroARSceneNavigator.tsx +30 -0
- package/components/AR/ViroCommonProps.ts +11 -0
- package/components/Material/ViroMaterials.ts +51 -0
- package/components/Utilities/ViroUtils.tsx +48 -0
- package/components/Utilities/ViroVersion.ts +1 -1
- package/components/Viro360Image.tsx +7 -0
- package/components/Viro3DObject.tsx +7 -1
- package/dist/components/AR/ViroARSceneNavigator.d.ts +23 -0
- package/dist/components/AR/ViroARSceneNavigator.js +5 -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/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/Viro360Image.d.ts +7 -0
- package/dist/components/Viro3DObject.d.ts +7 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/plugins/withViro.d.ts +11 -0
- package/dist/plugins/withViroIos.js +12 -8
- package/index.ts +8 -0
- package/ios/ViroReact.podspec +2 -1
- 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 +20 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +12 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGLTFLoader.h +49 -4
- 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/VROPortal.h +17 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderContext.h +41 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderer.h +15 -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/include/VRT360Image.h +1 -0
- package/ios/dist/include/VRTARSceneNavigator.h +4 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +8 -8
|
Binary file
|
|
Binary file
|
|
@@ -130,6 +130,28 @@ type Props = ViewProps & {
|
|
|
130
130
|
*/
|
|
131
131
|
depthDebugEnabled?: boolean;
|
|
132
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Enable semantic segmentation debug visualization. When enabled, the camera
|
|
135
|
+
* background shows a color overlay for each real-world category (sky, building, tree,
|
|
136
|
+
* road, sidewalk, terrain, structure, object, vehicle, person, water).
|
|
137
|
+
* Requires `setSemanticModeEnabled(true)` to be called on the scene navigator first.
|
|
138
|
+
*
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
semanticDebugEnabled?: boolean;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Confidence threshold (0.0–1.0) below which semantic labels are discarded (treated
|
|
145
|
+
* as unlabeled = 0) before the texture is uploaded to the GPU. Higher values reduce
|
|
146
|
+
* noise and boundary blinking at the cost of smaller labeled regions.
|
|
147
|
+
*
|
|
148
|
+
* Only used on Android (ARCore provides per-pixel confidence). On iOS, ARKit's
|
|
149
|
+
* segmentation is already temporally smoothed by the OS.
|
|
150
|
+
*
|
|
151
|
+
* @default 0.0
|
|
152
|
+
*/
|
|
153
|
+
semanticConfidenceThreshold?: number;
|
|
154
|
+
|
|
133
155
|
/**
|
|
134
156
|
* [iOS Only] Prefer monocular depth estimation over LiDAR.
|
|
135
157
|
* When true, monocular depth will be used even on devices with LiDAR.
|
|
@@ -1105,6 +1127,12 @@ export class ViroARSceneNavigator extends React.Component<Props, State> {
|
|
|
1105
1127
|
);
|
|
1106
1128
|
};
|
|
1107
1129
|
|
|
1130
|
+
_rvGetSceneAssets = async (sceneId: string): Promise<any> => {
|
|
1131
|
+
return await ViroARSceneNavigatorModule.rvGetSceneAssets(
|
|
1132
|
+
findNodeHandle(this), sceneId
|
|
1133
|
+
);
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1108
1136
|
_rvAttachAssetToCloudAnchor = async (
|
|
1109
1137
|
anchorId: string,
|
|
1110
1138
|
fileUrl: string,
|
|
@@ -1394,6 +1422,7 @@ export class ViroARSceneNavigator extends React.Component<Props, State> {
|
|
|
1394
1422
|
rvAttachAssetToCloudAnchor: this._rvAttachAssetToCloudAnchor,
|
|
1395
1423
|
rvRemoveAssetFromCloudAnchor: this._rvRemoveAssetFromCloudAnchor,
|
|
1396
1424
|
rvTrackCloudAnchorResolution: this._rvTrackCloudAnchorResolution,
|
|
1425
|
+
rvGetSceneAssets: this._rvGetSceneAssets,
|
|
1397
1426
|
// Assets API
|
|
1398
1427
|
rvUploadAsset: this._rvUploadAsset,
|
|
1399
1428
|
// Scene Semantics API
|
|
@@ -1452,6 +1481,7 @@ export class ViroARSceneNavigator extends React.Component<Props, State> {
|
|
|
1452
1481
|
rvAttachAssetToCloudAnchor: this._rvAttachAssetToCloudAnchor,
|
|
1453
1482
|
rvRemoveAssetFromCloudAnchor: this._rvRemoveAssetFromCloudAnchor,
|
|
1454
1483
|
rvTrackCloudAnchorResolution: this._rvTrackCloudAnchorResolution,
|
|
1484
|
+
rvGetSceneAssets: this._rvGetSceneAssets,
|
|
1455
1485
|
// Assets API
|
|
1456
1486
|
rvUploadAsset: this._rvUploadAsset,
|
|
1457
1487
|
// Scene Semantics API
|
|
@@ -103,6 +103,17 @@ export type ViroObjectProps = {
|
|
|
103
103
|
shadowCastingBitMask?: number;
|
|
104
104
|
|
|
105
105
|
shaderModifiers?: ViroShaderModifiers;
|
|
106
|
+
/**
|
|
107
|
+
* Apply shader modifiers from named materials to this node and all its children,
|
|
108
|
+
* preserving embedded textures (e.g. GLB/VRX). Unlike `materials`, which replaces
|
|
109
|
+
* the root geometry's material entirely, `shaderOverrides` merges only the shader
|
|
110
|
+
* modifiers and rendering properties from the named material onto every child mesh
|
|
111
|
+
* in the hierarchy. Use this for GLB models when you want to apply semantic masking,
|
|
112
|
+
* custom effects, or other per-material shader modifiers without losing the model's
|
|
113
|
+
* original textures and skinning.
|
|
114
|
+
*
|
|
115
|
+
* Accepts an array of material names previously registered via `ViroMaterials.createMaterials`.
|
|
116
|
+
*/
|
|
106
117
|
shaderOverrides?: string[];
|
|
107
118
|
materialUniforms?: { [key: string]: any } | ViroShaderUniform[];
|
|
108
119
|
|
|
@@ -54,6 +54,43 @@ export type ViroResolvedCubeMap = {
|
|
|
54
54
|
pz: ImageResolvedAssetSource;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
+
export type ViroSemanticMaskMode = "showOnly" | "hide" | "debug";
|
|
58
|
+
|
|
59
|
+
export type ViroSemanticLabel =
|
|
60
|
+
| "sky"
|
|
61
|
+
| "building"
|
|
62
|
+
| "tree"
|
|
63
|
+
| "road"
|
|
64
|
+
| "sidewalk"
|
|
65
|
+
| "terrain"
|
|
66
|
+
| "structure"
|
|
67
|
+
| "object"
|
|
68
|
+
| "vehicle"
|
|
69
|
+
| "person"
|
|
70
|
+
| "water";
|
|
71
|
+
|
|
72
|
+
export type ViroSemanticMaskConfig = {
|
|
73
|
+
/** Whether to show the material only where the label matches, or to hide it there. */
|
|
74
|
+
mode: ViroSemanticMaskMode;
|
|
75
|
+
/** One or more semantic labels to match against. */
|
|
76
|
+
labels: ViroSemanticLabel[];
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Maps VROSemanticLabel enum value → bit position (bit N = label N, value 1-11).
|
|
80
|
+
const kSemanticLabelBit: Record<ViroSemanticLabel, number> = {
|
|
81
|
+
sky: 1 << 1,
|
|
82
|
+
building: 1 << 2,
|
|
83
|
+
tree: 1 << 3,
|
|
84
|
+
road: 1 << 4,
|
|
85
|
+
sidewalk: 1 << 5,
|
|
86
|
+
terrain: 1 << 6,
|
|
87
|
+
structure: 1 << 7,
|
|
88
|
+
object: 1 << 8,
|
|
89
|
+
vehicle: 1 << 9,
|
|
90
|
+
person: 1 << 10,
|
|
91
|
+
water: 1 << 11,
|
|
92
|
+
};
|
|
93
|
+
|
|
57
94
|
export type ViroShaderModifier = {
|
|
58
95
|
body?: string;
|
|
59
96
|
uniforms?: string;
|
|
@@ -116,6 +153,10 @@ export type ViroMaterial = {
|
|
|
116
153
|
ambientOcclusionTexture?: any; // TODO: types
|
|
117
154
|
shaderModifiers?: ViroShaderModifiers;
|
|
118
155
|
materialUniforms?: ViroShaderUniform[];
|
|
156
|
+
/** Semantic masking — shows or hides the material based on ARCore scene semantics labels.
|
|
157
|
+
* Requires `setSemanticModeEnabled(true)` on the AR scene navigator.
|
|
158
|
+
* Only supported on Android (ARCore). Gracefully no-ops on iOS. */
|
|
159
|
+
semanticMask?: ViroSemanticMaskConfig;
|
|
119
160
|
};
|
|
120
161
|
|
|
121
162
|
export type ViroMaterialDict = {
|
|
@@ -163,6 +204,16 @@ export class ViroMaterials {
|
|
|
163
204
|
} else if (prop.endsWith("color") || prop.endsWith("Color")) {
|
|
164
205
|
var color = processColor(material[prop]);
|
|
165
206
|
resultMaterial[prop] = color;
|
|
207
|
+
} else if (prop === "semanticMask") {
|
|
208
|
+
const config = material[prop] as ViroSemanticMaskConfig;
|
|
209
|
+
let labelMask = 0;
|
|
210
|
+
for (const label of config.labels) {
|
|
211
|
+
labelMask |= kSemanticLabelBit[label] ?? 0;
|
|
212
|
+
}
|
|
213
|
+
resultMaterial["semanticMask"] = {
|
|
214
|
+
mode: config.mode,
|
|
215
|
+
labelMask,
|
|
216
|
+
};
|
|
166
217
|
} else {
|
|
167
218
|
//just apply material property directly.
|
|
168
219
|
resultMaterial[prop] = material[prop];
|
|
@@ -136,6 +136,54 @@ export function gpsToArWorld(
|
|
|
136
136
|
];
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
export type ViroPermission = "camera" | "microphone" | "storage" | "location";
|
|
140
|
+
|
|
141
|
+
const ALL_PERMISSIONS: ViroPermission[] = [
|
|
142
|
+
"camera",
|
|
143
|
+
"microphone",
|
|
144
|
+
"storage",
|
|
145
|
+
"location",
|
|
146
|
+
];
|
|
147
|
+
|
|
148
|
+
export interface ViroPermissionsResult {
|
|
149
|
+
camera?: boolean;
|
|
150
|
+
microphone?: boolean;
|
|
151
|
+
storage?: boolean;
|
|
152
|
+
location?: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Request the specified permissions required for Viro AR to function.
|
|
157
|
+
* Omit `permissions` to request all four (camera, microphone, storage, location).
|
|
158
|
+
* Only the requested keys are present in the resolved result.
|
|
159
|
+
*/
|
|
160
|
+
export function requestRequiredPermissions(
|
|
161
|
+
permissions: ViroPermission[] = ALL_PERMISSIONS
|
|
162
|
+
): Promise<ViroPermissionsResult> {
|
|
163
|
+
if (Platform.OS === "ios") {
|
|
164
|
+
return NativeModules.VRTARUtils.requestRequiredPermissions(permissions);
|
|
165
|
+
} else {
|
|
166
|
+
return NativeModules.VRTARSceneNavigatorModule.requestRequiredPermissions(
|
|
167
|
+
permissions
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Check the current status of the specified permissions without prompting the user.
|
|
174
|
+
* Omit `permissions` to check all four (camera, microphone, storage, location).
|
|
175
|
+
* Only the requested keys are present in the resolved result.
|
|
176
|
+
*/
|
|
177
|
+
export function checkPermissions(
|
|
178
|
+
permissions: ViroPermission[] = ALL_PERMISSIONS
|
|
179
|
+
): Promise<ViroPermissionsResult> {
|
|
180
|
+
if (Platform.OS === "ios") {
|
|
181
|
+
return NativeModules.VRTARUtils.checkPermissions(permissions);
|
|
182
|
+
} else {
|
|
183
|
+
return NativeModules.VRTARSceneNavigatorModule.checkPermissions(permissions);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
139
187
|
export interface ViroiOSArSupportResponse {
|
|
140
188
|
isARSupported: boolean;
|
|
141
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VIRO_VERSION = "2.
|
|
1
|
+
export const VIRO_VERSION = "2.54.0";
|
|
@@ -37,6 +37,13 @@ type Props = ViewProps & {
|
|
|
37
37
|
format?: "RGBA8" | "RGB565";
|
|
38
38
|
steroMode?: "LeftRight" | "RightLeft" | "TopBottom" | "BottomTop" | "None";
|
|
39
39
|
isHdr?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* When true, the image is rendered as a sky-effect overlay: it appears only over pixels
|
|
42
|
+
* semantically labeled as sky by ARCore/ARKit scene semantics, using alpha blending via
|
|
43
|
+
* the confidence texture for smooth boundary transitions. Requires scene semantics to be
|
|
44
|
+
* enabled on the AR session. Has no effect in VR mode. Default false.
|
|
45
|
+
*/
|
|
46
|
+
skyEffect?: boolean;
|
|
40
47
|
/**
|
|
41
48
|
* Callback triggered when we are processing the assets to be
|
|
42
49
|
* displayed in this 360 Photo (either downloading / reading from file).
|
|
@@ -30,7 +30,13 @@ type Props = {
|
|
|
30
30
|
*/
|
|
31
31
|
resources?: ImageSourcePropType[];
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Sets morph target weights for GLB/GLTF models that contain morph targets (blend shapes).
|
|
34
|
+
* Each entry pairs a target name (as exported from the model) with a blend weight in [0, 1].
|
|
35
|
+
*
|
|
36
|
+
* Example:
|
|
37
|
+
* morphTargets={[{ target: "Smile", weight: 0.8 }, { target: "Blink", weight: 1.0 }]}
|
|
38
|
+
*
|
|
39
|
+
* Use getMorphTargets() to discover the available target names at runtime.
|
|
34
40
|
*/
|
|
35
41
|
morphTargets?: Array<{
|
|
36
42
|
target?: string;
|
|
@@ -80,6 +80,26 @@ type Props = ViewProps & {
|
|
|
80
80
|
* @default false
|
|
81
81
|
*/
|
|
82
82
|
depthDebugEnabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Enable semantic segmentation debug visualization. When enabled, the camera
|
|
85
|
+
* background shows a color overlay for each real-world category (sky, building, tree,
|
|
86
|
+
* road, sidewalk, terrain, structure, object, vehicle, person, water).
|
|
87
|
+
* Requires `setSemanticModeEnabled(true)` to be called on the scene navigator first.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
semanticDebugEnabled?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Confidence threshold (0.0–1.0) below which semantic labels are discarded (treated
|
|
94
|
+
* as unlabeled = 0) before the texture is uploaded to the GPU. Higher values reduce
|
|
95
|
+
* noise and boundary blinking at the cost of smaller labeled regions.
|
|
96
|
+
*
|
|
97
|
+
* Only used on Android (ARCore provides per-pixel confidence). On iOS, ARKit's
|
|
98
|
+
* segmentation is already temporally smoothed by the OS.
|
|
99
|
+
*
|
|
100
|
+
* @default 0.0
|
|
101
|
+
*/
|
|
102
|
+
semanticConfidenceThreshold?: number;
|
|
83
103
|
/**
|
|
84
104
|
* [iOS Only] Prefer monocular depth estimation over LiDAR.
|
|
85
105
|
* When true, monocular depth will be used even on devices with LiDAR.
|
|
@@ -479,6 +499,7 @@ export declare class ViroARSceneNavigator extends React.Component<Props, State>
|
|
|
479
499
|
_rvUpdateCloudAnchor: (anchorId: string, name: string, description: string, isPublic: boolean) => Promise<any>;
|
|
480
500
|
_rvDeleteCloudAnchor: (anchorId: string) => Promise<any>;
|
|
481
501
|
_rvFindNearbyCloudAnchors: (latitude: number, longitude: number, radius: number, limit: number) => Promise<any>;
|
|
502
|
+
_rvGetSceneAssets: (sceneId: string) => Promise<any>;
|
|
482
503
|
_rvAttachAssetToCloudAnchor: (anchorId: string, fileUrl: string, fileSize: number, name: string, assetType: string, externalUserId: string) => Promise<any>;
|
|
483
504
|
_rvRemoveAssetFromCloudAnchor: (anchorId: string, assetId: string) => Promise<any>;
|
|
484
505
|
_rvTrackCloudAnchorResolution: (anchorId: string, success: boolean, confidence: number, matchCount: number, inlierCount: number, processingTimeMs: number, platform: string, externalUserId: string) => Promise<any>;
|
|
@@ -597,6 +618,7 @@ export declare class ViroARSceneNavigator extends React.Component<Props, State>
|
|
|
597
618
|
rvAttachAssetToCloudAnchor: (anchorId: string, fileUrl: string, fileSize: number, name: string, assetType: string, externalUserId: string) => Promise<any>;
|
|
598
619
|
rvRemoveAssetFromCloudAnchor: (anchorId: string, assetId: string) => Promise<any>;
|
|
599
620
|
rvTrackCloudAnchorResolution: (anchorId: string, success: boolean, confidence: number, matchCount: number, inlierCount: number, processingTimeMs: number, platform: string, externalUserId: string) => Promise<any>;
|
|
621
|
+
rvGetSceneAssets: (sceneId: string) => Promise<any>;
|
|
600
622
|
rvUploadAsset: (filePath: string, assetType: string, fileName: string, appUserId?: string) => Promise<any>;
|
|
601
623
|
isSemanticModeSupported: () => Promise<ViroSemanticSupportResult>;
|
|
602
624
|
setSemanticModeEnabled: (enabled: boolean) => void;
|
|
@@ -648,6 +670,7 @@ export declare class ViroARSceneNavigator extends React.Component<Props, State>
|
|
|
648
670
|
rvAttachAssetToCloudAnchor: (anchorId: string, fileUrl: string, fileSize: number, name: string, assetType: string, externalUserId: string) => Promise<any>;
|
|
649
671
|
rvRemoveAssetFromCloudAnchor: (anchorId: string, assetId: string) => Promise<any>;
|
|
650
672
|
rvTrackCloudAnchorResolution: (anchorId: string, success: boolean, confidence: number, matchCount: number, inlierCount: number, processingTimeMs: number, platform: string, externalUserId: string) => Promise<any>;
|
|
673
|
+
rvGetSceneAssets: (sceneId: string) => Promise<any>;
|
|
651
674
|
rvUploadAsset: (filePath: string, assetType: string, fileName: string, appUserId?: string) => Promise<any>;
|
|
652
675
|
isSemanticModeSupported: () => Promise<ViroSemanticSupportResult>;
|
|
653
676
|
setSemanticModeEnabled: (enabled: boolean) => void;
|
|
@@ -681,6 +681,9 @@ class ViroARSceneNavigator extends React.Component {
|
|
|
681
681
|
_rvFindNearbyCloudAnchors = async (latitude, longitude, radius, limit) => {
|
|
682
682
|
return await ViroARSceneNavigatorModule.rvFindNearbyCloudAnchors((0, react_native_1.findNodeHandle)(this), latitude, longitude, radius, limit);
|
|
683
683
|
};
|
|
684
|
+
_rvGetSceneAssets = async (sceneId) => {
|
|
685
|
+
return await ViroARSceneNavigatorModule.rvGetSceneAssets((0, react_native_1.findNodeHandle)(this), sceneId);
|
|
686
|
+
};
|
|
684
687
|
_rvAttachAssetToCloudAnchor = async (anchorId, fileUrl, fileSize, name, assetType, externalUserId) => {
|
|
685
688
|
return await ViroARSceneNavigatorModule.rvAttachAssetToCloudAnchor((0, react_native_1.findNodeHandle)(this), anchorId, fileUrl, fileSize, name, assetType, externalUserId);
|
|
686
689
|
};
|
|
@@ -901,6 +904,7 @@ class ViroARSceneNavigator extends React.Component {
|
|
|
901
904
|
rvAttachAssetToCloudAnchor: this._rvAttachAssetToCloudAnchor,
|
|
902
905
|
rvRemoveAssetFromCloudAnchor: this._rvRemoveAssetFromCloudAnchor,
|
|
903
906
|
rvTrackCloudAnchorResolution: this._rvTrackCloudAnchorResolution,
|
|
907
|
+
rvGetSceneAssets: this._rvGetSceneAssets,
|
|
904
908
|
// Assets API
|
|
905
909
|
rvUploadAsset: this._rvUploadAsset,
|
|
906
910
|
// Scene Semantics API
|
|
@@ -959,6 +963,7 @@ class ViroARSceneNavigator extends React.Component {
|
|
|
959
963
|
rvAttachAssetToCloudAnchor: this._rvAttachAssetToCloudAnchor,
|
|
960
964
|
rvRemoveAssetFromCloudAnchor: this._rvRemoveAssetFromCloudAnchor,
|
|
961
965
|
rvTrackCloudAnchorResolution: this._rvTrackCloudAnchorResolution,
|
|
966
|
+
rvGetSceneAssets: this._rvGetSceneAssets,
|
|
962
967
|
// Assets API
|
|
963
968
|
rvUploadAsset: this._rvUploadAsset,
|
|
964
969
|
// Scene Semantics API
|
|
@@ -54,6 +54,17 @@ export type ViroObjectProps = {
|
|
|
54
54
|
lightReceivingBitMask?: number;
|
|
55
55
|
shadowCastingBitMask?: number;
|
|
56
56
|
shaderModifiers?: ViroShaderModifiers;
|
|
57
|
+
/**
|
|
58
|
+
* Apply shader modifiers from named materials to this node and all its children,
|
|
59
|
+
* preserving embedded textures (e.g. GLB/VRX). Unlike `materials`, which replaces
|
|
60
|
+
* the root geometry's material entirely, `shaderOverrides` merges only the shader
|
|
61
|
+
* modifiers and rendering properties from the named material onto every child mesh
|
|
62
|
+
* in the hierarchy. Use this for GLB models when you want to apply semantic masking,
|
|
63
|
+
* custom effects, or other per-material shader modifiers without losing the model's
|
|
64
|
+
* original textures and skinning.
|
|
65
|
+
*
|
|
66
|
+
* Accepts an array of material names previously registered via `ViroMaterials.createMaterials`.
|
|
67
|
+
*/
|
|
57
68
|
shaderOverrides?: string[];
|
|
58
69
|
materialUniforms?: {
|
|
59
70
|
[key: string]: any;
|
|
@@ -27,6 +27,14 @@ export type ViroResolvedCubeMap = {
|
|
|
27
27
|
nz: ImageResolvedAssetSource;
|
|
28
28
|
pz: ImageResolvedAssetSource;
|
|
29
29
|
};
|
|
30
|
+
export type ViroSemanticMaskMode = "showOnly" | "hide" | "debug";
|
|
31
|
+
export type ViroSemanticLabel = "sky" | "building" | "tree" | "road" | "sidewalk" | "terrain" | "structure" | "object" | "vehicle" | "person" | "water";
|
|
32
|
+
export type ViroSemanticMaskConfig = {
|
|
33
|
+
/** Whether to show the material only where the label matches, or to hide it there. */
|
|
34
|
+
mode: ViroSemanticMaskMode;
|
|
35
|
+
/** One or more semantic labels to match against. */
|
|
36
|
+
labels: ViroSemanticLabel[];
|
|
37
|
+
};
|
|
30
38
|
export type ViroShaderModifier = {
|
|
31
39
|
body?: string;
|
|
32
40
|
uniforms?: string;
|
|
@@ -86,6 +94,10 @@ export type ViroMaterial = {
|
|
|
86
94
|
ambientOcclusionTexture?: any;
|
|
87
95
|
shaderModifiers?: ViroShaderModifiers;
|
|
88
96
|
materialUniforms?: ViroShaderUniform[];
|
|
97
|
+
/** Semantic masking — shows or hides the material based on ARCore scene semantics labels.
|
|
98
|
+
* Requires `setSemanticModeEnabled(true)` on the AR scene navigator.
|
|
99
|
+
* Only supported on Android (ARCore). Gracefully no-ops on iOS. */
|
|
100
|
+
semanticMask?: ViroSemanticMaskConfig;
|
|
89
101
|
};
|
|
90
102
|
export type ViroMaterialDict = {
|
|
91
103
|
[key: string]: ViroMaterial;
|
|
@@ -23,6 +23,20 @@ const resolveAssetSource_1 = __importDefault(require("react-native/Libraries/Ima
|
|
|
23
23
|
var MaterialManager = react_native_1.NativeModules.VRTMaterialManager ||
|
|
24
24
|
react_native_1.TurboModuleRegistry.get("VRTMaterialManager");
|
|
25
25
|
console.log("VRTMaterialManager lookup:", MaterialManager ? "FOUND" : "NOT FOUND");
|
|
26
|
+
// Maps VROSemanticLabel enum value → bit position (bit N = label N, value 1-11).
|
|
27
|
+
const kSemanticLabelBit = {
|
|
28
|
+
sky: 1 << 1,
|
|
29
|
+
building: 1 << 2,
|
|
30
|
+
tree: 1 << 3,
|
|
31
|
+
road: 1 << 4,
|
|
32
|
+
sidewalk: 1 << 5,
|
|
33
|
+
terrain: 1 << 6,
|
|
34
|
+
structure: 1 << 7,
|
|
35
|
+
object: 1 << 8,
|
|
36
|
+
vehicle: 1 << 9,
|
|
37
|
+
person: 1 << 10,
|
|
38
|
+
water: 1 << 11,
|
|
39
|
+
};
|
|
26
40
|
class ViroMaterials {
|
|
27
41
|
static createMaterials(materials) {
|
|
28
42
|
var result = {};
|
|
@@ -65,6 +79,17 @@ class ViroMaterials {
|
|
|
65
79
|
var color = (0, react_native_1.processColor)(material[prop]);
|
|
66
80
|
resultMaterial[prop] = color;
|
|
67
81
|
}
|
|
82
|
+
else if (prop === "semanticMask") {
|
|
83
|
+
const config = material[prop];
|
|
84
|
+
let labelMask = 0;
|
|
85
|
+
for (const label of config.labels) {
|
|
86
|
+
labelMask |= kSemanticLabelBit[label] ?? 0;
|
|
87
|
+
}
|
|
88
|
+
resultMaterial["semanticMask"] = {
|
|
89
|
+
mode: config.mode,
|
|
90
|
+
labelMask,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
68
93
|
else {
|
|
69
94
|
//just apply material property directly.
|
|
70
95
|
resultMaterial[prop] = material[prop];
|
|
@@ -63,6 +63,29 @@ export interface RVGeospatialListResult {
|
|
|
63
63
|
data: RVGeospatialAnchor[];
|
|
64
64
|
total?: number;
|
|
65
65
|
}
|
|
66
|
+
export interface RVSceneAsset {
|
|
67
|
+
id: string;
|
|
68
|
+
name: string;
|
|
69
|
+
description?: string | null;
|
|
70
|
+
file_url?: string | null;
|
|
71
|
+
file_size?: number | null;
|
|
72
|
+
asset_type_name?: "3D-MODEL" | "TEXT" | "IMAGE" | "VIDEO" | null;
|
|
73
|
+
position_x?: number | null;
|
|
74
|
+
position_y?: number | null;
|
|
75
|
+
position_z?: number | null;
|
|
76
|
+
rotation_x?: number | null;
|
|
77
|
+
rotation_y?: number | null;
|
|
78
|
+
rotation_z?: number | null;
|
|
79
|
+
scale?: number | null;
|
|
80
|
+
latitude: number;
|
|
81
|
+
longitude: number;
|
|
82
|
+
is_draggable: boolean;
|
|
83
|
+
trigger_image_url?: string | null;
|
|
84
|
+
trigger_image_orientation?: "Up" | "Down" | "Left" | "Right" | null;
|
|
85
|
+
trigger_image_physical_width_m?: number | null;
|
|
86
|
+
created_at: string;
|
|
87
|
+
updated_at: string;
|
|
88
|
+
}
|
|
66
89
|
export interface RVCloudAnchor {
|
|
67
90
|
id: string;
|
|
68
91
|
project_id: string;
|
|
@@ -102,6 +125,8 @@ export declare class ReactVisionClient {
|
|
|
102
125
|
listCloudAnchors(projectId: string, limit?: number, offset?: number): Promise<RVApiResult<RVCloudAnchor[]>>;
|
|
103
126
|
/** Delete a cloud anchor. */
|
|
104
127
|
deleteCloudAnchor(id: string): Promise<RVApiResult<null>>;
|
|
128
|
+
/** Fetch all assets for a scene by scene ID. */
|
|
129
|
+
getSceneAssets(sceneId: string): Promise<RVApiResult<RVSceneAsset[]>>;
|
|
105
130
|
private _get;
|
|
106
131
|
private _post;
|
|
107
132
|
private _patch;
|
|
@@ -82,6 +82,17 @@ class ReactVisionClient {
|
|
|
82
82
|
return this._delete(`/cloud-anchors/${id}`);
|
|
83
83
|
}
|
|
84
84
|
// --------------------------------------------------------------------------
|
|
85
|
+
// Scenes
|
|
86
|
+
// --------------------------------------------------------------------------
|
|
87
|
+
/** Fetch all assets for a scene by scene ID. */
|
|
88
|
+
async getSceneAssets(sceneId) {
|
|
89
|
+
const result = await this._get(`/functions/v1/scenes/${encodeURIComponent(sceneId)}/assets`);
|
|
90
|
+
if (!result.success)
|
|
91
|
+
return result;
|
|
92
|
+
const assets = result.data?.assets ?? result.data ?? [];
|
|
93
|
+
return { success: true, data: assets };
|
|
94
|
+
}
|
|
95
|
+
// --------------------------------------------------------------------------
|
|
85
96
|
// Internal fetch helpers
|
|
86
97
|
// --------------------------------------------------------------------------
|
|
87
98
|
async _get(path) {
|
|
@@ -49,6 +49,25 @@ export declare function latLngToMercator(lat: number, lng: number): [number, num
|
|
|
49
49
|
* @returns [arX, arY, arZ] position in metres relative to the device
|
|
50
50
|
*/
|
|
51
51
|
export declare function gpsToArWorld(devicePose: ViroGeospatialPose, anchorLat: number, anchorLng: number, anchorAlt: number): [number, number, number];
|
|
52
|
+
export type ViroPermission = "camera" | "microphone" | "storage" | "location";
|
|
53
|
+
export interface ViroPermissionsResult {
|
|
54
|
+
camera?: boolean;
|
|
55
|
+
microphone?: boolean;
|
|
56
|
+
storage?: boolean;
|
|
57
|
+
location?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Request the specified permissions required for Viro AR to function.
|
|
61
|
+
* Omit `permissions` to request all four (camera, microphone, storage, location).
|
|
62
|
+
* Only the requested keys are present in the resolved result.
|
|
63
|
+
*/
|
|
64
|
+
export declare function requestRequiredPermissions(permissions?: ViroPermission[]): Promise<ViroPermissionsResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Check the current status of the specified permissions without prompting the user.
|
|
67
|
+
* Omit `permissions` to check all four (camera, microphone, storage, location).
|
|
68
|
+
* Only the requested keys are present in the resolved result.
|
|
69
|
+
*/
|
|
70
|
+
export declare function checkPermissions(permissions?: ViroPermission[]): Promise<ViroPermissionsResult>;
|
|
52
71
|
export interface ViroiOSArSupportResponse {
|
|
53
72
|
isARSupported: boolean;
|
|
54
73
|
}
|
|
@@ -14,6 +14,8 @@ exports.polarToCartesian = polarToCartesian;
|
|
|
14
14
|
exports.polarToCartesianActual = polarToCartesianActual;
|
|
15
15
|
exports.latLngToMercator = latLngToMercator;
|
|
16
16
|
exports.gpsToArWorld = gpsToArWorld;
|
|
17
|
+
exports.requestRequiredPermissions = requestRequiredPermissions;
|
|
18
|
+
exports.checkPermissions = checkPermissions;
|
|
17
19
|
exports.isARSupportedOnDevice = isARSupportedOnDevice;
|
|
18
20
|
/**
|
|
19
21
|
* Convert the given polar coords of the form [r, theta, phi] to cartesian
|
|
@@ -113,6 +115,38 @@ function gpsToArWorld(devicePose, anchorLat, anchorLng, anchorAlt) {
|
|
|
113
115
|
-distance * Math.cos(relBearing), // arZ
|
|
114
116
|
];
|
|
115
117
|
}
|
|
118
|
+
const ALL_PERMISSIONS = [
|
|
119
|
+
"camera",
|
|
120
|
+
"microphone",
|
|
121
|
+
"storage",
|
|
122
|
+
"location",
|
|
123
|
+
];
|
|
124
|
+
/**
|
|
125
|
+
* Request the specified permissions required for Viro AR to function.
|
|
126
|
+
* Omit `permissions` to request all four (camera, microphone, storage, location).
|
|
127
|
+
* Only the requested keys are present in the resolved result.
|
|
128
|
+
*/
|
|
129
|
+
function requestRequiredPermissions(permissions = ALL_PERMISSIONS) {
|
|
130
|
+
if (react_native_1.Platform.OS === "ios") {
|
|
131
|
+
return react_native_1.NativeModules.VRTARUtils.requestRequiredPermissions(permissions);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return react_native_1.NativeModules.VRTARSceneNavigatorModule.requestRequiredPermissions(permissions);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check the current status of the specified permissions without prompting the user.
|
|
139
|
+
* Omit `permissions` to check all four (camera, microphone, storage, location).
|
|
140
|
+
* Only the requested keys are present in the resolved result.
|
|
141
|
+
*/
|
|
142
|
+
function checkPermissions(permissions = ALL_PERMISSIONS) {
|
|
143
|
+
if (react_native_1.Platform.OS === "ios") {
|
|
144
|
+
return react_native_1.NativeModules.VRTARUtils.checkPermissions(permissions);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return react_native_1.NativeModules.VRTARSceneNavigatorModule.checkPermissions(permissions);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
116
150
|
function isARSupportedOnDevice() {
|
|
117
151
|
return new Promise((resolve, reject) => {
|
|
118
152
|
if (react_native_1.Platform.OS == "ios") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VIRO_VERSION = "2.
|
|
1
|
+
export declare const VIRO_VERSION = "2.54.0";
|
|
@@ -11,6 +11,13 @@ type Props = ViewProps & {
|
|
|
11
11
|
format?: "RGBA8" | "RGB565";
|
|
12
12
|
steroMode?: "LeftRight" | "RightLeft" | "TopBottom" | "BottomTop" | "None";
|
|
13
13
|
isHdr?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* When true, the image is rendered as a sky-effect overlay: it appears only over pixels
|
|
16
|
+
* semantically labeled as sky by ARCore/ARKit scene semantics, using alpha blending via
|
|
17
|
+
* the confidence texture for smooth boundary transitions. Requires scene semantics to be
|
|
18
|
+
* enabled on the AR session. Has no effect in VR mode. Default false.
|
|
19
|
+
*/
|
|
20
|
+
skyEffect?: boolean;
|
|
14
21
|
/**
|
|
15
22
|
* Callback triggered when we are processing the assets to be
|
|
16
23
|
* displayed in this 360 Photo (either downloading / reading from file).
|
|
@@ -13,7 +13,13 @@ type Props = {
|
|
|
13
13
|
*/
|
|
14
14
|
resources?: ImageSourcePropType[];
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Sets morph target weights for GLB/GLTF models that contain morph targets (blend shapes).
|
|
17
|
+
* Each entry pairs a target name (as exported from the model) with a blend weight in [0, 1].
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
* morphTargets={[{ target: "Smile", weight: 0.8 }, { target: "Blink", weight: 1.0 }]}
|
|
21
|
+
*
|
|
22
|
+
* Use getMorphTargets() to discover the available target names at runtime.
|
|
17
23
|
*/
|
|
18
24
|
morphTargets?: Array<{
|
|
19
25
|
target?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,10 +52,10 @@ import { ViroVRSceneNavigator } from "./components/ViroVRSceneNavigator";
|
|
|
52
52
|
import { Viro3DSceneNavigator } from "./components/Viro3DSceneNavigator";
|
|
53
53
|
import { ViroTextStyle } from "./components/Styles/ViroTextStyle";
|
|
54
54
|
import { ViroStyle } from "./components/Styles/ViroStyle";
|
|
55
|
-
import { polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, ViroARSupportResponse, latLngToMercator, gpsToArWorld } from "./components/Utilities/ViroUtils";
|
|
55
|
+
import { polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, requestRequiredPermissions, checkPermissions, ViroARSupportResponse, ViroPermissionsResult, ViroPermission, latLngToMercator, gpsToArWorld } from "./components/Utilities/ViroUtils";
|
|
56
56
|
import { ViroARCamera } from "./components/AR/ViroARCamera";
|
|
57
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";
|
|
58
58
|
import { ViroSurface } from "./components/ViroSurface";
|
|
59
59
|
import { ViroSceneNavigator } from "./components/ViroSceneNavigator";
|
|
60
60
|
import { VIRO_VERSION } from "./components/Utilities/ViroVersion";
|
|
61
|
-
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, Viro3DSceneNavigator, ViroARTrackingReasonConstants, ViroRecordingErrorConstants, ViroTrackingStateConstants, polarToCartesian, polarToCartesianActual, isARSupportedOnDevice, latLngToMercator, gpsToArWorld, ViroARSupportResponse, 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, };
|
|
61
|
+
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, Viro3DSceneNavigator, 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, };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ViroARTrackingReasonConstants = exports.Viro3DSceneNavigator = 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.VIRO_VERSION = exports.ViroRotateStateTypes = exports.ViroPinchStateTypes = exports.ViroClickStateTypes = exports.gpsToArWorld = exports.latLngToMercator = exports.isARSupportedOnDevice = exports.polarToCartesianActual = exports.polarToCartesian = exports.ViroTrackingStateConstants = exports.ViroRecordingErrorConstants = void 0;
|
|
4
|
+
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 = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* Copyright (c) 2016-present, Viro Media, Inc.
|
|
7
7
|
* All rights reserved.
|
|
@@ -107,6 +107,8 @@ const ViroUtils_1 = require("./components/Utilities/ViroUtils");
|
|
|
107
107
|
Object.defineProperty(exports, "polarToCartesian", { enumerable: true, get: function () { return ViroUtils_1.polarToCartesian; } });
|
|
108
108
|
Object.defineProperty(exports, "polarToCartesianActual", { enumerable: true, get: function () { return ViroUtils_1.polarToCartesianActual; } });
|
|
109
109
|
Object.defineProperty(exports, "isARSupportedOnDevice", { enumerable: true, get: function () { return ViroUtils_1.isARSupportedOnDevice; } });
|
|
110
|
+
Object.defineProperty(exports, "requestRequiredPermissions", { enumerable: true, get: function () { return ViroUtils_1.requestRequiredPermissions; } });
|
|
111
|
+
Object.defineProperty(exports, "checkPermissions", { enumerable: true, get: function () { return ViroUtils_1.checkPermissions; } });
|
|
110
112
|
Object.defineProperty(exports, "latLngToMercator", { enumerable: true, get: function () { return ViroUtils_1.latLngToMercator; } });
|
|
111
113
|
Object.defineProperty(exports, "gpsToArWorld", { enumerable: true, get: function () { return ViroUtils_1.gpsToArWorld; } });
|
|
112
114
|
const ViroARCamera_1 = require("./components/AR/ViroARCamera");
|
|
@@ -118,6 +118,17 @@ export interface ViroConfigurationOptions {
|
|
|
118
118
|
* DEFAULTS TO: false (unless provider is "arcore")
|
|
119
119
|
*/
|
|
120
120
|
includeARCore?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether to include the ARCore/Semantics pod for scene semantic segmentation.
|
|
123
|
+
* When true, adds the ARCore/Semantics pod (and ARCore/CloudAnchors as a base dependency)
|
|
124
|
+
* without enabling cloud anchors or geospatial features.
|
|
125
|
+
*
|
|
126
|
+
* Use this when you want semantic masking (ViroMaterial.semanticMask) but do NOT need
|
|
127
|
+
* cloud anchors or geospatial anchors. If includeARCore is already true, this has no effect.
|
|
128
|
+
*
|
|
129
|
+
* DEFAULTS TO: false
|
|
130
|
+
*/
|
|
131
|
+
includeSemantics?: boolean;
|
|
121
132
|
};
|
|
122
133
|
android?: {
|
|
123
134
|
xRMode?: XrMode[];
|