@reactvision/react-viro 2.42.0 → 2.43.1
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 +12 -6
- package/android/react_viro/react_viro-release.aar +0 -0
- package/components/AR/ViroARPlaneSelector.tsx +76 -37
- package/components/Utilities/ViroVersion.ts +1 -1
- package/dist/components/AR/ViroARPlaneSelector.d.ts +1 -1
- package/dist/components/AR/ViroARPlaneSelector.js +46 -18
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/dynamic-index.d.ts +11 -0
- package/dist/dynamic-index.js +28 -0
- package/dist/examples/AutoDetectionExample.d.ts +10 -0
- package/dist/examples/AutoDetectionExample.js +91 -0
- package/dist/fabric-interop/NativeViro.d.ts +42 -0
- package/dist/fabric-interop/NativeViro.js +262 -0
- package/dist/fabric-interop/ViroEventsManager.d.ts +83 -0
- package/dist/fabric-interop/ViroEventsManager.js +222 -0
- package/dist/fabric-interop/ViroFabricContainer.d.ts +34 -0
- package/dist/fabric-interop/ViroFabricContainer.js +200 -0
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.d.ts +35 -0
- package/dist/fabric-interop/android/src/main/js/specs/ViroFabricContainerViewNativeComponent.js +20 -0
- package/dist/fabric-interop/components/AR/ViroARPlane.d.ts +22 -0
- package/dist/fabric-interop/components/AR/ViroARPlane.js +95 -0
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.d.ts +43 -0
- package/dist/fabric-interop/components/AR/ViroARPlaneSelector.js +152 -0
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.d.ts +55 -0
- package/dist/fabric-interop/components/AR/ViroARTrackingTargets.js +85 -0
- package/dist/fabric-interop/components/AR/ViroCommonProps.d.ts +91 -0
- package/dist/fabric-interop/components/AR/ViroCommonProps.js +7 -0
- package/dist/fabric-interop/components/Animation/ViroAnimations.d.ts +48 -0
- package/dist/fabric-interop/components/Animation/ViroAnimations.js +64 -0
- package/dist/fabric-interop/components/Material/ViroMaterials.d.ts +66 -0
- package/dist/fabric-interop/components/Material/ViroMaterials.js +85 -0
- package/dist/fabric-interop/components/Types/ViroEvents.d.ts +202 -0
- package/dist/fabric-interop/components/Types/ViroEvents.js +53 -0
- package/dist/fabric-interop/components/Types/ViroUtils.d.ts +137 -0
- package/dist/fabric-interop/components/Types/ViroUtils.js +7 -0
- package/dist/fabric-interop/components/Viro360Image.d.ts +23 -0
- package/dist/fabric-interop/components/Viro360Image.js +45 -0
- package/dist/fabric-interop/components/Viro360Video.d.ts +29 -0
- package/dist/fabric-interop/components/Viro360Video.js +47 -0
- package/dist/fabric-interop/components/Viro3DObject.d.ts +60 -0
- package/dist/fabric-interop/components/Viro3DObject.js +49 -0
- package/dist/fabric-interop/components/Viro3DSceneNavigator.d.ts +49 -0
- package/dist/fabric-interop/components/Viro3DSceneNavigator.js +388 -0
- package/dist/fabric-interop/components/ViroARCamera.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARCamera.js +64 -0
- package/dist/fabric-interop/components/ViroARImageMarker.d.ts +21 -0
- package/dist/fabric-interop/components/ViroARImageMarker.js +71 -0
- package/dist/fabric-interop/components/ViroARObjectMarker.d.ts +21 -0
- package/dist/fabric-interop/components/ViroARObjectMarker.js +71 -0
- package/dist/fabric-interop/components/ViroARPlane.d.ts +24 -0
- package/dist/fabric-interop/components/ViroARPlane.js +88 -0
- package/dist/fabric-interop/components/ViroARScene.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARScene.js +89 -0
- package/dist/fabric-interop/components/ViroARSceneNavigator.d.ts +29 -0
- package/dist/fabric-interop/components/ViroARSceneNavigator.js +76 -0
- package/dist/fabric-interop/components/ViroAmbientLight.d.ts +19 -0
- package/dist/fabric-interop/components/ViroAmbientLight.js +46 -0
- package/dist/fabric-interop/components/ViroAnimatedComponent.d.ts +24 -0
- package/dist/fabric-interop/components/ViroAnimatedComponent.js +63 -0
- package/dist/fabric-interop/components/ViroAnimatedImage.d.ts +28 -0
- package/dist/fabric-interop/components/ViroAnimatedImage.js +49 -0
- package/dist/fabric-interop/components/ViroBox.d.ts +20 -0
- package/dist/fabric-interop/components/ViroBox.js +47 -0
- package/dist/fabric-interop/components/ViroButton.d.ts +32 -0
- package/dist/fabric-interop/components/ViroButton.js +92 -0
- package/dist/fabric-interop/components/ViroCamera.d.ts +17 -0
- package/dist/fabric-interop/components/ViroCamera.js +30 -0
- package/dist/fabric-interop/components/ViroController.d.ts +19 -0
- package/dist/fabric-interop/components/ViroController.js +64 -0
- package/dist/fabric-interop/components/ViroDirectionalLight.d.ts +28 -0
- package/dist/fabric-interop/components/ViroDirectionalLight.js +55 -0
- package/dist/fabric-interop/components/ViroFlexView.d.ts +36 -0
- package/dist/fabric-interop/components/ViroFlexView.js +97 -0
- package/dist/fabric-interop/components/ViroGeometry.d.ts +23 -0
- package/dist/fabric-interop/components/ViroGeometry.js +50 -0
- package/dist/fabric-interop/components/ViroGlobal.d.ts +45 -0
- package/dist/fabric-interop/components/ViroGlobal.js +20 -0
- package/dist/fabric-interop/components/ViroImage.d.ts +29 -0
- package/dist/fabric-interop/components/ViroImage.js +52 -0
- package/dist/fabric-interop/components/ViroLightingEnvironment.d.ts +19 -0
- package/dist/fabric-interop/components/ViroLightingEnvironment.js +44 -0
- package/dist/fabric-interop/components/ViroMaterialVideo.d.ts +30 -0
- package/dist/fabric-interop/components/ViroMaterialVideo.js +48 -0
- package/dist/fabric-interop/components/ViroNode.d.ts +36 -0
- package/dist/fabric-interop/components/ViroNode.js +28 -0
- package/dist/fabric-interop/components/ViroOmniLight.d.ts +21 -0
- package/dist/fabric-interop/components/ViroOmniLight.js +48 -0
- package/dist/fabric-interop/components/ViroOrbitCamera.d.ts +17 -0
- package/dist/fabric-interop/components/ViroOrbitCamera.js +30 -0
- package/dist/fabric-interop/components/ViroParticleEmitter.d.ts +51 -0
- package/dist/fabric-interop/components/ViroParticleEmitter.js +50 -0
- package/dist/fabric-interop/components/ViroPolygon.d.ts +20 -0
- package/dist/fabric-interop/components/ViroPolygon.js +47 -0
- package/dist/fabric-interop/components/ViroPolyline.d.ts +19 -0
- package/dist/fabric-interop/components/ViroPolyline.js +46 -0
- package/dist/fabric-interop/components/ViroPortal.d.ts +16 -0
- package/dist/fabric-interop/components/ViroPortal.js +73 -0
- package/dist/fabric-interop/components/ViroPortalScene.d.ts +16 -0
- package/dist/fabric-interop/components/ViroPortalScene.js +29 -0
- package/dist/fabric-interop/components/ViroQuad.d.ts +39 -0
- package/dist/fabric-interop/components/ViroQuad.js +49 -0
- package/dist/fabric-interop/components/ViroScene.d.ts +29 -0
- package/dist/fabric-interop/components/ViroScene.js +103 -0
- package/dist/fabric-interop/components/ViroSceneNavigator.d.ts +23 -0
- package/dist/fabric-interop/components/ViroSceneNavigator.js +73 -0
- package/dist/fabric-interop/components/ViroSkyBox.d.ts +39 -0
- package/dist/fabric-interop/components/ViroSkyBox.js +44 -0
- package/dist/fabric-interop/components/ViroSound.d.ts +23 -0
- package/dist/fabric-interop/components/ViroSound.js +46 -0
- package/dist/fabric-interop/components/ViroSoundField.d.ts +24 -0
- package/dist/fabric-interop/components/ViroSoundField.js +47 -0
- package/dist/fabric-interop/components/ViroSpatialSound.d.ts +27 -0
- package/dist/fabric-interop/components/ViroSpatialSound.js +50 -0
- package/dist/fabric-interop/components/ViroSphere.d.ts +22 -0
- package/dist/fabric-interop/components/ViroSphere.js +49 -0
- package/dist/fabric-interop/components/ViroSpinner.d.ts +18 -0
- package/dist/fabric-interop/components/ViroSpinner.js +45 -0
- package/dist/fabric-interop/components/ViroSpotLight.d.ts +30 -0
- package/dist/fabric-interop/components/ViroSpotLight.js +57 -0
- package/dist/fabric-interop/components/ViroSurface.d.ts +38 -0
- package/dist/fabric-interop/components/ViroSurface.js +48 -0
- package/dist/fabric-interop/components/ViroText.d.ts +36 -0
- package/dist/fabric-interop/components/ViroText.js +59 -0
- package/dist/fabric-interop/components/ViroUtils.d.ts +63 -0
- package/dist/fabric-interop/components/ViroUtils.js +140 -0
- package/dist/fabric-interop/components/ViroVRSceneNavigator.d.ts +25 -0
- package/dist/fabric-interop/components/ViroVRSceneNavigator.js +73 -0
- package/dist/fabric-interop/components/ViroVideo.d.ts +32 -0
- package/dist/fabric-interop/components/ViroVideo.js +52 -0
- package/dist/fabric-interop/components/index.d.ts +62 -0
- package/dist/fabric-interop/components/index.js +144 -0
- package/dist/fabric-interop/examples/BasicSceneExample.d.ts +11 -0
- package/dist/fabric-interop/examples/BasicSceneExample.js +244 -0
- package/dist/fabric-interop/examples/ComprehensiveExample.d.ts +13 -0
- package/dist/fabric-interop/examples/ComprehensiveExample.js +327 -0
- package/dist/fabric-interop/examples/SimpleARExample.d.ts +8 -0
- package/dist/fabric-interop/examples/SimpleARExample.js +62 -0
- package/dist/fabric-interop/index.d.ts +14 -0
- package/dist/fabric-interop/index.js +117 -0
- package/dist/fabric-interop/specs/ViroEventsTurboModule.d.ts +19 -0
- package/dist/fabric-interop/specs/ViroEventsTurboModule.js +11 -0
- package/dist/fabric-interop/test/BasicFunctionalityTest.d.ts +9 -0
- package/dist/fabric-interop/test/BasicFunctionalityTest.js +222 -0
- package/dist/fabric.d.ts +13 -0
- package/dist/fabric.js +29 -0
- package/dist/plugins/withViro.d.ts +3 -0
- package/dist/plugins/withViro.js +19 -0
- package/dist/plugins/withViroAndroid.js +24 -20
- package/dist/plugins/withViroIos.js +20 -2
- package/dynamic-index-source.d.ts +77 -0
- package/dynamic-index.ts +41 -0
- package/fabric-interop/NativeViro.ts +335 -0
- package/fabric-interop/README.md +282 -0
- package/fabric-interop/ViroEventsManager.js +257 -0
- package/fabric-interop/ViroFabricContainer.tsx +273 -0
- package/fabric-interop/components/AR/ViroARPlane.tsx +108 -0
- package/fabric-interop/components/AR/ViroARPlaneSelector.tsx +185 -0
- package/fabric-interop/components/AR/ViroARTrackingTargets.ts +108 -0
- package/fabric-interop/components/AR/ViroCommonProps.ts +140 -0
- package/fabric-interop/components/Animation/ViroAnimations.ts +96 -0
- package/fabric-interop/components/Material/ViroMaterials.ts +127 -0
- package/fabric-interop/components/Resources/viro_spinner_1.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1_w.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1a.png +0 -0
- package/fabric-interop/components/Resources/viro_spinner_1a_w.png +0 -0
- package/fabric-interop/components/Types/ViroEvents.ts +285 -0
- package/fabric-interop/components/Types/ViroUtils.ts +160 -0
- package/fabric-interop/components/Viro360Image.tsx +70 -0
- package/fabric-interop/components/Viro360Video.tsx +78 -0
- package/fabric-interop/components/Viro3DObject.tsx +122 -0
- package/fabric-interop/components/Viro3DSceneNavigator.tsx +503 -0
- package/fabric-interop/components/ViroARCamera.tsx +105 -0
- package/fabric-interop/components/ViroARImageMarker.tsx +98 -0
- package/fabric-interop/components/ViroARObjectMarker.tsx +100 -0
- package/fabric-interop/components/ViroARPlane.tsx +120 -0
- package/fabric-interop/components/ViroARScene.tsx +127 -0
- package/fabric-interop/components/ViroARSceneNavigator.tsx +82 -0
- package/fabric-interop/components/ViroAmbientLight.tsx +62 -0
- package/fabric-interop/components/ViroAnimatedComponent.tsx +91 -0
- package/fabric-interop/components/ViroAnimatedImage.tsx +81 -0
- package/fabric-interop/components/ViroBox.tsx +72 -0
- package/fabric-interop/components/ViroButton.tsx +125 -0
- package/fabric-interop/components/ViroCamera.tsx +45 -0
- package/fabric-interop/components/ViroController.tsx +87 -0
- package/fabric-interop/components/ViroDirectionalLight.tsx +84 -0
- package/fabric-interop/components/ViroFlexView.tsx +146 -0
- package/fabric-interop/components/ViroGeometry.tsx +78 -0
- package/fabric-interop/components/ViroGlobal.ts +114 -0
- package/fabric-interop/components/ViroImage.tsx +85 -0
- package/fabric-interop/components/ViroLightingEnvironment.tsx +63 -0
- package/fabric-interop/components/ViroMaterialVideo.tsx +82 -0
- package/fabric-interop/components/ViroNode.tsx +62 -0
- package/fabric-interop/components/ViroOmniLight.tsx +66 -0
- package/fabric-interop/components/ViroOrbitCamera.tsx +45 -0
- package/fabric-interop/components/ViroParticleEmitter.tsx +111 -0
- package/fabric-interop/components/ViroPolygon.tsx +72 -0
- package/fabric-interop/components/ViroPolyline.tsx +71 -0
- package/fabric-interop/components/ViroPortal.tsx +91 -0
- package/fabric-interop/components/ViroPortalScene.tsx +43 -0
- package/fabric-interop/components/ViroQuad.tsx +82 -0
- package/fabric-interop/components/ViroScene.tsx +117 -0
- package/fabric-interop/components/ViroSceneNavigator.tsx +71 -0
- package/fabric-interop/components/ViroSkyBox.tsx +75 -0
- package/fabric-interop/components/ViroSound.tsx +71 -0
- package/fabric-interop/components/ViroSoundField.tsx +75 -0
- package/fabric-interop/components/ViroSpatialSound.tsx +81 -0
- package/fabric-interop/components/ViroSphere.tsx +75 -0
- package/fabric-interop/components/ViroSpinner.tsx +63 -0
- package/fabric-interop/components/ViroSpotLight.tsx +86 -0
- package/fabric-interop/components/ViroSurface.tsx +80 -0
- package/fabric-interop/components/ViroText.tsx +114 -0
- package/fabric-interop/components/ViroUtils.ts +208 -0
- package/fabric-interop/components/ViroVRSceneNavigator.tsx +75 -0
- package/fabric-interop/components/ViroVideo.tsx +91 -0
- package/fabric-interop/components/index.ts +94 -0
- package/fabric-interop/dist/NativeViro.d.ts +43 -0
- package/fabric-interop/dist/NativeViro.d.ts.map +1 -0
- package/fabric-interop/dist/NativeViro.js +263 -0
- package/fabric-interop/dist/NativeViro.js.map +1 -0
- package/fabric-interop/dist/ViroFabricContainer.d.ts +35 -0
- package/fabric-interop/dist/ViroFabricContainer.d.ts.map +1 -0
- package/fabric-interop/dist/ViroFabricContainer.js +201 -0
- package/fabric-interop/dist/ViroFabricContainer.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts +23 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.js +96 -0
- package/fabric-interop/dist/components/AR/ViroARPlane.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts +44 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js +156 -0
- package/fabric-interop/dist/components/AR/ViroARPlaneSelector.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts +56 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js +86 -0
- package/fabric-interop/dist/components/AR/ViroARTrackingTargets.js.map +1 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts +92 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.d.ts.map +1 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.js +8 -0
- package/fabric-interop/dist/components/AR/ViroCommonProps.js.map +1 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts +49 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.d.ts.map +1 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.js +65 -0
- package/fabric-interop/dist/components/Animation/ViroAnimations.js.map +1 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts +67 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.d.ts.map +1 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.js +86 -0
- package/fabric-interop/dist/components/Material/ViroMaterials.js.map +1 -0
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts +203 -0
- package/fabric-interop/dist/components/Types/ViroEvents.d.ts.map +1 -0
- package/fabric-interop/dist/components/Types/ViroEvents.js +54 -0
- package/fabric-interop/dist/components/Types/ViroEvents.js.map +1 -0
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts +138 -0
- package/fabric-interop/dist/components/Types/ViroUtils.d.ts.map +1 -0
- package/fabric-interop/dist/components/Types/ViroUtils.js +8 -0
- package/fabric-interop/dist/components/Types/ViroUtils.js.map +1 -0
- package/fabric-interop/dist/components/Viro360Image.d.ts +24 -0
- package/fabric-interop/dist/components/Viro360Image.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro360Image.js +47 -0
- package/fabric-interop/dist/components/Viro360Image.js.map +1 -0
- package/fabric-interop/dist/components/Viro360Video.d.ts +30 -0
- package/fabric-interop/dist/components/Viro360Video.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro360Video.js +49 -0
- package/fabric-interop/dist/components/Viro360Video.js.map +1 -0
- package/fabric-interop/dist/components/Viro3DObject.d.ts +61 -0
- package/fabric-interop/dist/components/Viro3DObject.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro3DObject.js +51 -0
- package/fabric-interop/dist/components/Viro3DObject.js.map +1 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts +50 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js +389 -0
- package/fabric-interop/dist/components/Viro3DSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroARCamera.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARCamera.js +65 -0
- package/fabric-interop/dist/components/ViroARCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts +22 -0
- package/fabric-interop/dist/components/ViroARImageMarker.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARImageMarker.js +72 -0
- package/fabric-interop/dist/components/ViroARImageMarker.js.map +1 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts +22 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.js +72 -0
- package/fabric-interop/dist/components/ViroARObjectMarker.js.map +1 -0
- package/fabric-interop/dist/components/ViroARPlane.d.ts +25 -0
- package/fabric-interop/dist/components/ViroARPlane.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARPlane.js +89 -0
- package/fabric-interop/dist/components/ViroARPlane.js.map +1 -0
- package/fabric-interop/dist/components/ViroARScene.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARScene.js +90 -0
- package/fabric-interop/dist/components/ViroARScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts +30 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.js +78 -0
- package/fabric-interop/dist/components/ViroARSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts +20 -0
- package/fabric-interop/dist/components/ViroAmbientLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAmbientLight.js +48 -0
- package/fabric-interop/dist/components/ViroAmbientLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts +25 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.js +65 -0
- package/fabric-interop/dist/components/ViroAnimatedComponent.js.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts +29 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.js +51 -0
- package/fabric-interop/dist/components/ViroAnimatedImage.js.map +1 -0
- package/fabric-interop/dist/components/ViroBox.d.ts +21 -0
- package/fabric-interop/dist/components/ViroBox.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroBox.js +49 -0
- package/fabric-interop/dist/components/ViroBox.js.map +1 -0
- package/fabric-interop/dist/components/ViroButton.d.ts +33 -0
- package/fabric-interop/dist/components/ViroButton.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroButton.js +94 -0
- package/fabric-interop/dist/components/ViroButton.js.map +1 -0
- package/fabric-interop/dist/components/ViroCamera.d.ts +18 -0
- package/fabric-interop/dist/components/ViroCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroCamera.js +31 -0
- package/fabric-interop/dist/components/ViroCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroController.d.ts +20 -0
- package/fabric-interop/dist/components/ViroController.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroController.js +65 -0
- package/fabric-interop/dist/components/ViroController.js.map +1 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts +29 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.js +57 -0
- package/fabric-interop/dist/components/ViroDirectionalLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroFlexView.d.ts +37 -0
- package/fabric-interop/dist/components/ViroFlexView.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroFlexView.js +98 -0
- package/fabric-interop/dist/components/ViroFlexView.js.map +1 -0
- package/fabric-interop/dist/components/ViroGeometry.d.ts +24 -0
- package/fabric-interop/dist/components/ViroGeometry.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroGeometry.js +52 -0
- package/fabric-interop/dist/components/ViroGeometry.js.map +1 -0
- package/fabric-interop/dist/components/ViroGlobal.d.ts +46 -0
- package/fabric-interop/dist/components/ViroGlobal.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroGlobal.js +21 -0
- package/fabric-interop/dist/components/ViroGlobal.js.map +1 -0
- package/fabric-interop/dist/components/ViroImage.d.ts +30 -0
- package/fabric-interop/dist/components/ViroImage.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroImage.js +54 -0
- package/fabric-interop/dist/components/ViroImage.js.map +1 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts +20 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.js +46 -0
- package/fabric-interop/dist/components/ViroLightingEnvironment.js.map +1 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts +31 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.js +50 -0
- package/fabric-interop/dist/components/ViroMaterialVideo.js.map +1 -0
- package/fabric-interop/dist/components/ViroNode.d.ts +37 -0
- package/fabric-interop/dist/components/ViroNode.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroNode.js +29 -0
- package/fabric-interop/dist/components/ViroNode.js.map +1 -0
- package/fabric-interop/dist/components/ViroOmniLight.d.ts +22 -0
- package/fabric-interop/dist/components/ViroOmniLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroOmniLight.js +50 -0
- package/fabric-interop/dist/components/ViroOmniLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts +18 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.js +31 -0
- package/fabric-interop/dist/components/ViroOrbitCamera.js.map +1 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts +52 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.js +52 -0
- package/fabric-interop/dist/components/ViroParticleEmitter.js.map +1 -0
- package/fabric-interop/dist/components/ViroPolygon.d.ts +21 -0
- package/fabric-interop/dist/components/ViroPolygon.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPolygon.js +49 -0
- package/fabric-interop/dist/components/ViroPolygon.js.map +1 -0
- package/fabric-interop/dist/components/ViroPolyline.d.ts +20 -0
- package/fabric-interop/dist/components/ViroPolyline.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPolyline.js +48 -0
- package/fabric-interop/dist/components/ViroPolyline.js.map +1 -0
- package/fabric-interop/dist/components/ViroPortal.d.ts +17 -0
- package/fabric-interop/dist/components/ViroPortal.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPortal.js +74 -0
- package/fabric-interop/dist/components/ViroPortal.js.map +1 -0
- package/fabric-interop/dist/components/ViroPortalScene.d.ts +17 -0
- package/fabric-interop/dist/components/ViroPortalScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroPortalScene.js +30 -0
- package/fabric-interop/dist/components/ViroPortalScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroQuad.d.ts +40 -0
- package/fabric-interop/dist/components/ViroQuad.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroQuad.js +51 -0
- package/fabric-interop/dist/components/ViroQuad.js.map +1 -0
- package/fabric-interop/dist/components/ViroScene.d.ts +30 -0
- package/fabric-interop/dist/components/ViroScene.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroScene.js +105 -0
- package/fabric-interop/dist/components/ViroScene.js.map +1 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts +24 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.js +74 -0
- package/fabric-interop/dist/components/ViroSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroSkyBox.d.ts +40 -0
- package/fabric-interop/dist/components/ViroSkyBox.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSkyBox.js +46 -0
- package/fabric-interop/dist/components/ViroSkyBox.js.map +1 -0
- package/fabric-interop/dist/components/ViroSound.d.ts +24 -0
- package/fabric-interop/dist/components/ViroSound.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSound.js +48 -0
- package/fabric-interop/dist/components/ViroSound.js.map +1 -0
- package/fabric-interop/dist/components/ViroSoundField.d.ts +25 -0
- package/fabric-interop/dist/components/ViroSoundField.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSoundField.js +49 -0
- package/fabric-interop/dist/components/ViroSoundField.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts +28 -0
- package/fabric-interop/dist/components/ViroSpatialSound.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpatialSound.js +52 -0
- package/fabric-interop/dist/components/ViroSpatialSound.js.map +1 -0
- package/fabric-interop/dist/components/ViroSphere.d.ts +23 -0
- package/fabric-interop/dist/components/ViroSphere.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSphere.js +51 -0
- package/fabric-interop/dist/components/ViroSphere.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpinner.d.ts +19 -0
- package/fabric-interop/dist/components/ViroSpinner.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpinner.js +47 -0
- package/fabric-interop/dist/components/ViroSpinner.js.map +1 -0
- package/fabric-interop/dist/components/ViroSpotLight.d.ts +31 -0
- package/fabric-interop/dist/components/ViroSpotLight.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSpotLight.js +59 -0
- package/fabric-interop/dist/components/ViroSpotLight.js.map +1 -0
- package/fabric-interop/dist/components/ViroSurface.d.ts +39 -0
- package/fabric-interop/dist/components/ViroSurface.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroSurface.js +50 -0
- package/fabric-interop/dist/components/ViroSurface.js.map +1 -0
- package/fabric-interop/dist/components/ViroText.d.ts +37 -0
- package/fabric-interop/dist/components/ViroText.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroText.js +61 -0
- package/fabric-interop/dist/components/ViroText.js.map +1 -0
- package/fabric-interop/dist/components/ViroUtils.d.ts +64 -0
- package/fabric-interop/dist/components/ViroUtils.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroUtils.js +141 -0
- package/fabric-interop/dist/components/ViroUtils.js.map +1 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts +26 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js +74 -0
- package/fabric-interop/dist/components/ViroVRSceneNavigator.js.map +1 -0
- package/fabric-interop/dist/components/ViroVideo.d.ts +33 -0
- package/fabric-interop/dist/components/ViroVideo.d.ts.map +1 -0
- package/fabric-interop/dist/components/ViroVideo.js +54 -0
- package/fabric-interop/dist/components/ViroVideo.js.map +1 -0
- package/fabric-interop/dist/components/index.d.ts +63 -0
- package/fabric-interop/dist/components/index.d.ts.map +1 -0
- package/fabric-interop/dist/components/index.js +145 -0
- package/fabric-interop/dist/components/index.js.map +1 -0
- package/fabric-interop/dist/index.d.ts +15 -0
- package/fabric-interop/dist/index.d.ts.map +1 -0
- package/fabric-interop/dist/index.js +118 -0
- package/fabric-interop/dist/index.js.map +1 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts +20 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.d.ts.map +1 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js +12 -0
- package/fabric-interop/dist/specs/ViroEventsTurboModule.js.map +1 -0
- package/fabric-interop/examples/BasicSceneExample.tsx +287 -0
- package/fabric-interop/examples/ComprehensiveExample.tsx +441 -0
- package/fabric-interop/examples/SimpleARExample.tsx +95 -0
- package/fabric-interop/global.d.ts +14 -0
- package/fabric-interop/index.ts +107 -0
- package/fabric-interop/metro.config.js +12 -0
- package/fabric-interop/package.json +40 -0
- package/fabric-interop/react-native.config.js +22 -0
- package/fabric-interop/scripts/validate-build.js +393 -0
- package/fabric-interop/scripts/validate-implementation.js +272 -0
- package/fabric-interop/specs/README.md +22 -0
- package/fabric-interop/specs/ViroEventsTurboModule.ts +27 -0
- package/fabric-interop/test/BasicFunctionalityTest.tsx +243 -0
- package/fabric-interop/tsconfig.json +38 -0
- package/fabric.d.ts +5 -0
- package/fabric.ts +14 -0
- package/ios/ViroReact.podspec +51 -11
- package/package.json +33 -20
- package/scripts/copy-types.js +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Viro3DObject.d.ts","sourceRoot":"","sources":["../../components/Viro3DObject.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,eAAe,EAIhB,MA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MAAM,CAAC;QACrB,KAAK,CAAC,EAAE;YACN,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,UAAU,CAAC;YACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;SACnB,CAAC;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,KAAK,CAAC,EAAE;YACN,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;YAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;SACpC,CAAC;QACF,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IAGF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwCpD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Viro3DObject
|
|
4
|
+
*
|
|
5
|
+
* A component for loading and displaying 3D models in various formats.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Viro3DObject = void 0;
|
|
9
|
+
const ViroUtils_1 = require("./ViroUtils");
|
|
10
|
+
/**
|
|
11
|
+
* Viro3DObject is a component for loading and displaying 3D models in various formats.
|
|
12
|
+
*/
|
|
13
|
+
const Viro3DObject = (props) => {
|
|
14
|
+
var _a;
|
|
15
|
+
// Convert common props to the format expected by the native code
|
|
16
|
+
const nativeProps = {
|
|
17
|
+
...(0, ViroUtils_1.convertCommonProps)(props),
|
|
18
|
+
source: props.source,
|
|
19
|
+
resources: props.resources,
|
|
20
|
+
type: props.type,
|
|
21
|
+
materials: props.materials,
|
|
22
|
+
morphTargets: props.morphTargets,
|
|
23
|
+
lightReceivingBitMask: props.lightReceivingBitMask,
|
|
24
|
+
shadowCastingBitMask: props.shadowCastingBitMask,
|
|
25
|
+
highAccuracyEvents: props.highAccuracyEvents,
|
|
26
|
+
physicsBody: props.physicsBody,
|
|
27
|
+
};
|
|
28
|
+
// Create the node (parent will be determined by context)
|
|
29
|
+
const nodeId = (0, ViroUtils_1.useViroNode)("object", nativeProps);
|
|
30
|
+
// Register event handlers using our new event system
|
|
31
|
+
(0, ViroUtils_1.useViroEventListeners)(nodeId, {
|
|
32
|
+
onHover: props.onHover,
|
|
33
|
+
onClick: props.onClick,
|
|
34
|
+
onClickState: props.onClickState,
|
|
35
|
+
onTouch: props.onTouch,
|
|
36
|
+
onScroll: props.onScroll,
|
|
37
|
+
onSwipe: props.onSwipe,
|
|
38
|
+
onDrag: props.onDrag,
|
|
39
|
+
onPinch: props.onPinch,
|
|
40
|
+
onRotate: props.onRotate,
|
|
41
|
+
onFuse: typeof props.onFuse === "function"
|
|
42
|
+
? props.onFuse
|
|
43
|
+
: (_a = props.onFuse) === null || _a === void 0 ? void 0 : _a.callback,
|
|
44
|
+
onCollision: props.onCollision,
|
|
45
|
+
onTransformUpdate: props.onTransformUpdate,
|
|
46
|
+
});
|
|
47
|
+
// Component doesn't have children, so just return null
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
exports.Viro3DObject = Viro3DObject;
|
|
51
|
+
//# sourceMappingURL=Viro3DObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Viro3DObject.js","sourceRoot":"","sources":["../../components/Viro3DObject.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,2CAK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uDAAuD;IACvD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxCW,QAAA,YAAY,gBAwCvB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viro3DSceneNavigator
|
|
3
|
+
*
|
|
4
|
+
* Component for transitioning between multiple scenes in a 3D environment.
|
|
5
|
+
*/
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { ViewProps } from "react-native";
|
|
8
|
+
import { ViroScene } from "./ViroScene";
|
|
9
|
+
type Props = ViewProps & {
|
|
10
|
+
/**
|
|
11
|
+
* initial scene key
|
|
12
|
+
*/
|
|
13
|
+
initialSceneKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A flag to enable/disable some debug features
|
|
16
|
+
*/
|
|
17
|
+
debug?: boolean;
|
|
18
|
+
viroAppProps?: any;
|
|
19
|
+
/**
|
|
20
|
+
* ViroSceneNavigator uses "scene" objects like the following to
|
|
21
|
+
* describe a scene.
|
|
22
|
+
*/
|
|
23
|
+
initialScene: {
|
|
24
|
+
/**
|
|
25
|
+
* The React Component to render for this scene.
|
|
26
|
+
*/
|
|
27
|
+
scene: typeof ViroScene;
|
|
28
|
+
passProps?: any;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Called when either the user physically decides to exit vr (hits
|
|
32
|
+
* the "X" button).
|
|
33
|
+
*/
|
|
34
|
+
onExitViro?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Renderer settings that can be used to enable or disable various
|
|
37
|
+
* renderer capabilities and algorithms.
|
|
38
|
+
*/
|
|
39
|
+
hdrEnabled?: boolean;
|
|
40
|
+
pbrEnabled?: boolean;
|
|
41
|
+
bloomEnabled?: boolean;
|
|
42
|
+
shadowsEnabled?: boolean;
|
|
43
|
+
multisamplingEnabled?: boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Viro3DSceneNavigator is used to transition between multiple scenes.
|
|
47
|
+
*/
|
|
48
|
+
export declare function Viro3DSceneNavigator(props: Props): React.ReactElement;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=Viro3DSceneNavigator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Viro3DSceneNavigator.d.ts","sourceRoot":"","sources":["../../components/Viro3DSceneNavigator.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,KAAK,KAAK,GAAG,SAAS,GAAG;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,YAAY,CAAC,EAAE,GAAG,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE;QACZ;;WAEG;QACH,KAAK,EAAE,OAAO,SAAS,CAAC;QACxB,SAAS,CAAC,EAAE,GAAG,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,YAAY,CA+arE"}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Viro3DSceneNavigator
|
|
4
|
+
*
|
|
5
|
+
* Component for transitioning between multiple scenes in a 3D environment.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
24
|
+
var ownKeys = function(o) {
|
|
25
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
26
|
+
var ar = [];
|
|
27
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
|
+
return ownKeys(o);
|
|
31
|
+
};
|
|
32
|
+
return function (mod) {
|
|
33
|
+
if (mod && mod.__esModule) return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
36
|
+
__setModuleDefault(result, mod);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
})();
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.Viro3DSceneNavigator = Viro3DSceneNavigator;
|
|
42
|
+
const React = __importStar(require("react"));
|
|
43
|
+
const react_1 = require("react");
|
|
44
|
+
const react_native_1 = require("react-native");
|
|
45
|
+
const NativeViro_1 = require("../NativeViro");
|
|
46
|
+
const ViroGlobal_1 = require("./ViroGlobal");
|
|
47
|
+
/**
|
|
48
|
+
* Viro3DSceneNavigator is used to transition between multiple scenes.
|
|
49
|
+
*/
|
|
50
|
+
function Viro3DSceneNavigator(props) {
|
|
51
|
+
const { initialSceneKey, initialScene, viroAppProps, onExitViro, debug = false, hdrEnabled, pbrEnabled, bloomEnabled, shadowsEnabled, multisamplingEnabled, style, ...rest } = props;
|
|
52
|
+
// Generate a random tag for scenes
|
|
53
|
+
const mathRandomOffsetRef = (0, react_1.useRef)(0);
|
|
54
|
+
const getRandomTag = () => {
|
|
55
|
+
const randomTag = Math.random() + mathRandomOffsetRef.current;
|
|
56
|
+
mathRandomOffsetRef.current++;
|
|
57
|
+
return randomTag.toString();
|
|
58
|
+
};
|
|
59
|
+
// Initialize state
|
|
60
|
+
const initialTag = initialSceneKey || getRandomTag();
|
|
61
|
+
const initialSceneObj = {
|
|
62
|
+
sceneClass: initialScene,
|
|
63
|
+
tag: initialTag,
|
|
64
|
+
referenceCount: 1,
|
|
65
|
+
};
|
|
66
|
+
const [sceneDictionary, setSceneDictionary] = (0, react_1.useState)({
|
|
67
|
+
[initialTag]: initialSceneObj,
|
|
68
|
+
});
|
|
69
|
+
const [sceneHistory, setSceneHistory] = (0, react_1.useState)([initialTag]);
|
|
70
|
+
const [currentSceneIndex, setCurrentSceneIndex] = (0, react_1.useState)(0);
|
|
71
|
+
// Create a ref for the navigator node
|
|
72
|
+
const navigatorRef = (0, react_1.useRef)((0, NativeViro_1.generateNodeId)());
|
|
73
|
+
// Set up event listeners
|
|
74
|
+
(0, react_1.useEffect)(() => {
|
|
75
|
+
if (!navigatorRef.current)
|
|
76
|
+
return;
|
|
77
|
+
const exitViroCallbackId = onExitViro
|
|
78
|
+
? (0, NativeViro_1.registerEventListener)(navigatorRef.current, "onExitViro", () => {
|
|
79
|
+
onExitViro();
|
|
80
|
+
})
|
|
81
|
+
: null;
|
|
82
|
+
// Clean up event listeners
|
|
83
|
+
return () => {
|
|
84
|
+
if (exitViroCallbackId) {
|
|
85
|
+
(0, NativeViro_1.unregisterEventListener)(navigatorRef.current, "onExitViro", exitViroCallbackId);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, [navigatorRef.current, onExitViro]);
|
|
89
|
+
/**
|
|
90
|
+
* Increments the reference count for a scene within sceneDictionary that is
|
|
91
|
+
* mapped to the given sceneKey. If no scenes are found / mapped, we create
|
|
92
|
+
* one, initialize it with a reference count of 1, and store it within the
|
|
93
|
+
* sceneDictionary for future reference.
|
|
94
|
+
*/
|
|
95
|
+
const incrementSceneReference = (scene, sceneKey, limitOne) => {
|
|
96
|
+
setSceneDictionary((prevDictionary) => {
|
|
97
|
+
const newDictionary = { ...prevDictionary };
|
|
98
|
+
if (!(sceneKey in newDictionary)) {
|
|
99
|
+
const newScene = {
|
|
100
|
+
sceneClass: scene,
|
|
101
|
+
tag: sceneKey,
|
|
102
|
+
referenceCount: 0,
|
|
103
|
+
};
|
|
104
|
+
newDictionary[sceneKey] = newScene;
|
|
105
|
+
}
|
|
106
|
+
// Error out if there are no scenes matching the given sceneKey
|
|
107
|
+
const currentScene = newDictionary[sceneKey];
|
|
108
|
+
if (!currentScene) {
|
|
109
|
+
console.log("ERROR: No scene found for: " + sceneKey);
|
|
110
|
+
return prevDictionary;
|
|
111
|
+
}
|
|
112
|
+
// Update the scene's reference count
|
|
113
|
+
if ((limitOne && currentScene.referenceCount < 1) || !limitOne) {
|
|
114
|
+
currentScene.referenceCount++;
|
|
115
|
+
}
|
|
116
|
+
newDictionary[sceneKey] = currentScene;
|
|
117
|
+
return newDictionary;
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Decrements the reference count for the last N scenes within
|
|
122
|
+
* the sceneHistory by 1. If nothing else references that given scene
|
|
123
|
+
* (counts equals 0), we then remove that scene from sceneDictionary.
|
|
124
|
+
*/
|
|
125
|
+
const decrementReferenceForLastNScenes = (n) => {
|
|
126
|
+
setSceneDictionary((prevDictionary) => {
|
|
127
|
+
const newDictionary = { ...prevDictionary };
|
|
128
|
+
// Now update and release any reference counts
|
|
129
|
+
for (let i = 1; i <= n; i++) {
|
|
130
|
+
const sceneTag = sceneHistory[sceneHistory.length - i];
|
|
131
|
+
const scene = newDictionary[sceneTag];
|
|
132
|
+
if (!scene)
|
|
133
|
+
continue;
|
|
134
|
+
scene.referenceCount--;
|
|
135
|
+
if (scene.referenceCount <= 0) {
|
|
136
|
+
delete newDictionary[sceneTag];
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
newDictionary[sceneTag] = scene;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return newDictionary;
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Adds the given sceneKey to the sceneHistory and updates the currentSceneIndex to point
|
|
147
|
+
* to the scene on the top of the history stack (the most recent scene).
|
|
148
|
+
*/
|
|
149
|
+
const addToHistory = (sceneKey) => {
|
|
150
|
+
setSceneHistory((prevHistory) => [...prevHistory, sceneKey]);
|
|
151
|
+
// Find the index of the scene in the dictionary
|
|
152
|
+
let index = 0;
|
|
153
|
+
for (const key in sceneDictionary) {
|
|
154
|
+
if (sceneKey === sceneDictionary[key].tag) {
|
|
155
|
+
setCurrentSceneIndex(index);
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
index++;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Instead of preserving history, we find the last pushed sceneKey within the history stack
|
|
163
|
+
* matching the given sceneKey and re-order it to the front.
|
|
164
|
+
*/
|
|
165
|
+
const reorderHistory = (sceneKey) => {
|
|
166
|
+
setSceneHistory((prevHistory) => {
|
|
167
|
+
// Find the last sceneKey within sceneHistory and remove it
|
|
168
|
+
const newHistory = [...prevHistory];
|
|
169
|
+
for (let i = newHistory.length - 1; i >= 0; i--) {
|
|
170
|
+
if (sceneKey === newHistory[i]) {
|
|
171
|
+
newHistory.splice(i, 1);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Add back the sceneKey to the front of the History stack
|
|
176
|
+
return [...newHistory, sceneKey];
|
|
177
|
+
});
|
|
178
|
+
// Find the index of the scene in the dictionary
|
|
179
|
+
let index = 0;
|
|
180
|
+
for (const key in sceneDictionary) {
|
|
181
|
+
if (sceneKey === sceneDictionary[key].tag) {
|
|
182
|
+
setCurrentSceneIndex(index);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
index++;
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Removes the last N scenes from the history stack
|
|
190
|
+
*/
|
|
191
|
+
const popHistoryByN = (n) => {
|
|
192
|
+
setSceneHistory((prevHistory) => {
|
|
193
|
+
const newHistory = [...prevHistory];
|
|
194
|
+
newHistory.splice(newHistory.length - n, n);
|
|
195
|
+
// Find the index of the last scene in the dictionary
|
|
196
|
+
if (newHistory.length > 0) {
|
|
197
|
+
const lastSceneTag = newHistory[newHistory.length - 1];
|
|
198
|
+
let index = 0;
|
|
199
|
+
for (const key in sceneDictionary) {
|
|
200
|
+
if (lastSceneTag === sceneDictionary[key].tag) {
|
|
201
|
+
setCurrentSceneIndex(index);
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
index++;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return newHistory;
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Pushes a scene and reference it with the given key if provided.
|
|
212
|
+
*/
|
|
213
|
+
const push = (param1, param2) => {
|
|
214
|
+
let sceneKey = undefined;
|
|
215
|
+
let scene = undefined;
|
|
216
|
+
if (typeof param1 === "string") {
|
|
217
|
+
sceneKey = param1;
|
|
218
|
+
scene = param2;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
scene = param1;
|
|
222
|
+
}
|
|
223
|
+
if (scene === undefined && sceneKey === undefined) {
|
|
224
|
+
console.log("ERROR: pushing requires either the scene tag, or both the tag and scene.");
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
else if (scene === undefined &&
|
|
228
|
+
sceneKey !== undefined &&
|
|
229
|
+
!(sceneKey in sceneDictionary)) {
|
|
230
|
+
console.log("ERROR: Cannot push with a new sceneKey with no associated scene.");
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (sceneKey === undefined ||
|
|
234
|
+
(typeof sceneKey === "string" && sceneKey.trim().length <= 0)) {
|
|
235
|
+
sceneKey = getRandomTag();
|
|
236
|
+
}
|
|
237
|
+
incrementSceneReference(scene, sceneKey, false);
|
|
238
|
+
addToHistory(sceneKey);
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Replace the top scene in the stack with the given scene.
|
|
242
|
+
*/
|
|
243
|
+
const replace = (param1, param2) => {
|
|
244
|
+
let sceneKey = undefined;
|
|
245
|
+
let scene = undefined;
|
|
246
|
+
if (typeof param1 === "string") {
|
|
247
|
+
sceneKey = param1;
|
|
248
|
+
scene = param2;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
scene = param1;
|
|
252
|
+
}
|
|
253
|
+
if (scene === undefined && sceneKey === undefined) {
|
|
254
|
+
console.log("ERROR: replacing requires either the scene tag, or both the tag and scene.");
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
else if (scene === undefined &&
|
|
258
|
+
sceneKey !== undefined &&
|
|
259
|
+
!(sceneKey in sceneDictionary)) {
|
|
260
|
+
console.log("ERROR: Cannot replace with a new sceneKey with no associated scene.");
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (sceneKey === undefined ||
|
|
264
|
+
(typeof sceneKey === "string" && sceneKey.trim().length <= 0)) {
|
|
265
|
+
sceneKey = getRandomTag();
|
|
266
|
+
}
|
|
267
|
+
// Pop 1 off the scene history, then push this scene
|
|
268
|
+
decrementReferenceForLastNScenes(1);
|
|
269
|
+
popHistoryByN(1);
|
|
270
|
+
incrementSceneReference(scene, sceneKey, false);
|
|
271
|
+
addToHistory(sceneKey);
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Jumps to a given scene that had been previously pushed.
|
|
275
|
+
*/
|
|
276
|
+
const jump = (param1, param2) => {
|
|
277
|
+
let sceneKey = undefined;
|
|
278
|
+
let scene = undefined;
|
|
279
|
+
if (typeof param1 === "string") {
|
|
280
|
+
sceneKey = param1;
|
|
281
|
+
scene = param2;
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
scene = param1;
|
|
285
|
+
}
|
|
286
|
+
if (scene === undefined && sceneKey === undefined) {
|
|
287
|
+
console.log("ERROR: jumping requires either the scene tag, or both the tag and scene.");
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
else if (scene === undefined &&
|
|
291
|
+
sceneKey !== undefined &&
|
|
292
|
+
!(sceneKey in sceneDictionary)) {
|
|
293
|
+
console.log("ERROR: Cannot jump with a new sceneKey with no associated scene.");
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
if (sceneKey === undefined ||
|
|
297
|
+
(typeof sceneKey === "string" && sceneKey.trim().length <= 0)) {
|
|
298
|
+
sceneKey = getRandomTag();
|
|
299
|
+
}
|
|
300
|
+
incrementSceneReference(scene, sceneKey, true);
|
|
301
|
+
reorderHistory(sceneKey);
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Pops the current scene from the stack
|
|
305
|
+
*/
|
|
306
|
+
const pop = () => {
|
|
307
|
+
popN(1);
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Pops N scenes from the stack
|
|
311
|
+
*/
|
|
312
|
+
const popN = (n) => {
|
|
313
|
+
if (n === 0) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (sceneHistory.length - n <= 0) {
|
|
317
|
+
console.log("WARN: Attempted to pop the root scene in ViroSceneNavigator!");
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
decrementReferenceForLastNScenes(n);
|
|
321
|
+
popHistoryByN(n);
|
|
322
|
+
};
|
|
323
|
+
/**
|
|
324
|
+
* Recenter the tracking
|
|
325
|
+
*/
|
|
326
|
+
const recenterTracking = () => {
|
|
327
|
+
const nativeViro = (0, ViroGlobal_1.getNativeViro)();
|
|
328
|
+
if (nativeViro && navigatorRef.current) {
|
|
329
|
+
nativeViro.recenterTracking(navigatorRef.current);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Project a 3D point to screen space
|
|
334
|
+
*/
|
|
335
|
+
const project = async (point) => {
|
|
336
|
+
const nativeViro = (0, ViroGlobal_1.getNativeViro)();
|
|
337
|
+
if (nativeViro && navigatorRef.current) {
|
|
338
|
+
return await nativeViro.project(navigatorRef.current, point);
|
|
339
|
+
}
|
|
340
|
+
return null;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Unproject a screen point to 3D space
|
|
344
|
+
*/
|
|
345
|
+
const unproject = async (point) => {
|
|
346
|
+
const nativeViro = (0, ViroGlobal_1.getNativeViro)();
|
|
347
|
+
if (nativeViro && navigatorRef.current) {
|
|
348
|
+
return await nativeViro.unproject(navigatorRef.current, point);
|
|
349
|
+
}
|
|
350
|
+
return null;
|
|
351
|
+
};
|
|
352
|
+
// Create the sceneNavigator object to pass to scenes
|
|
353
|
+
const sceneNavigator = {
|
|
354
|
+
push,
|
|
355
|
+
pop,
|
|
356
|
+
popN,
|
|
357
|
+
jump,
|
|
358
|
+
replace,
|
|
359
|
+
recenterTracking,
|
|
360
|
+
project,
|
|
361
|
+
unproject,
|
|
362
|
+
viroAppProps: viroAppProps || {},
|
|
363
|
+
};
|
|
364
|
+
// Render the scenes
|
|
365
|
+
const renderScenes = () => {
|
|
366
|
+
const views = [];
|
|
367
|
+
let i = 0;
|
|
368
|
+
for (const key in sceneDictionary) {
|
|
369
|
+
const sceneInfo = sceneDictionary[key];
|
|
370
|
+
const Component = sceneInfo.sceneClass.scene;
|
|
371
|
+
const passProps = sceneInfo.sceneClass.passProps || {};
|
|
372
|
+
views.push(<Component key={`scene${i}`} sceneNavigator={sceneNavigator} {...passProps}/>);
|
|
373
|
+
i++;
|
|
374
|
+
}
|
|
375
|
+
return views;
|
|
376
|
+
};
|
|
377
|
+
// Render the navigator
|
|
378
|
+
return (<react_native_1.View style={[styles.container, style]} {...rest}>
|
|
379
|
+
{renderScenes()}
|
|
380
|
+
</react_native_1.View>);
|
|
381
|
+
}
|
|
382
|
+
const styles = react_native_1.StyleSheet.create({
|
|
383
|
+
container: {
|
|
384
|
+
flex: 1,
|
|
385
|
+
justifyContent: "center",
|
|
386
|
+
alignItems: "center",
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
//# sourceMappingURL=Viro3DSceneNavigator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Viro3DSceneNavigator.js","sourceRoot":"","sources":["../../components/Viro3DSceneNavigator.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DH,oDA+aC;AAxeD,6CAA+B;AAC/B,iCAAoD;AACpD,+CAA2D;AAE3D,8CAIuB;AAEvB,6CAA6C;AA4C7C;;GAEG;AACH,SAAgB,oBAAoB,CAAC,KAAY;IAC/C,MAAM,EACJ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,KAAK,GAAG,KAAK,EACb,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,KAAK,EACL,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,mCAAmC;IACnC,MAAM,mBAAmB,GAAG,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC9D,mBAAmB,CAAC,OAAO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ACd,CACH,CAAC;YACF,CAAC,EAAE,CAAC;QACN,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,uBAAuB;IACvB,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAC/C;MAAA,CAAC,YAAY,EAAE,CACjB;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViroARCamera
|
|
3
|
+
*
|
|
4
|
+
* A component for controlling the camera in an AR scene.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { ViroCommonProps } from "./ViroUtils";
|
|
8
|
+
export type ViroARCameraTransformUpdateEvent = {
|
|
9
|
+
position: [number, number, number];
|
|
10
|
+
rotation: [number, number, number];
|
|
11
|
+
forward: [number, number, number];
|
|
12
|
+
up: [number, number, number];
|
|
13
|
+
};
|
|
14
|
+
export type ViroARTrackingStateEvent = {
|
|
15
|
+
state: "NORMAL" | "LIMITED" | "NOT_AVAILABLE";
|
|
16
|
+
reason?: "NONE" | "INITIALIZING" | "EXCESSIVE_MOTION" | "INSUFFICIENT_FEATURES";
|
|
17
|
+
};
|
|
18
|
+
export interface ViroARCameraProps extends Omit<ViroCommonProps, "onTransformUpdate"> {
|
|
19
|
+
active?: boolean;
|
|
20
|
+
onTransformUpdate?: (event: ViroARCameraTransformUpdateEvent) => void;
|
|
21
|
+
onTrackingUpdated?: (event: ViroARTrackingStateEvent) => void;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ViroARCamera is a component for controlling the camera in an AR scene.
|
|
26
|
+
* It provides information about the camera's position and orientation in the real world,
|
|
27
|
+
* as well as tracking state updates.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ViroARCamera: React.FC<ViroARCameraProps>;
|
|
30
|
+
//# sourceMappingURL=ViroARCamera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViroARCamera.d.ts","sourceRoot":"","sources":["../../components/ViroARCamera.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,eAAe,EAKhB,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B,CAAC;AAGF,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAC;IAC9C,MAAM,CAAC,EACH,MAAM,GACN,cAAc,GACd,kBAAkB,GAClB,uBAAuB,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAElD,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,gCAAgC,KAAK,IAAI,CAAC;IACtE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAG9D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAoDpD,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ViroARCamera
|
|
4
|
+
*
|
|
5
|
+
* A component for controlling the camera in an AR scene.
|
|
6
|
+
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ViroARCamera = void 0;
|
|
12
|
+
const react_1 = __importDefault(require("react"));
|
|
13
|
+
const ViroUtils_1 = require("./ViroUtils");
|
|
14
|
+
const ViroGlobal_1 = require("./ViroGlobal");
|
|
15
|
+
/**
|
|
16
|
+
* ViroARCamera is a component for controlling the camera in an AR scene.
|
|
17
|
+
* It provides information about the camera's position and orientation in the real world,
|
|
18
|
+
* as well as tracking state updates.
|
|
19
|
+
*/
|
|
20
|
+
const ViroARCamera = (props) => {
|
|
21
|
+
// Convert common props to the format expected by the native code
|
|
22
|
+
const nativeProps = {
|
|
23
|
+
...(0, ViroUtils_1.convertCommonProps)(props),
|
|
24
|
+
active: props.active,
|
|
25
|
+
};
|
|
26
|
+
// Create the node (parent will be determined by context)
|
|
27
|
+
const nodeId = (0, ViroUtils_1.useViroNode)("arCamera", nativeProps);
|
|
28
|
+
// Register event handlers
|
|
29
|
+
react_1.default.useEffect(() => {
|
|
30
|
+
const nativeViro = (0, ViroGlobal_1.getNativeViro)();
|
|
31
|
+
if (!nativeViro)
|
|
32
|
+
return;
|
|
33
|
+
const eventHandlers = [
|
|
34
|
+
{ name: "onTransformUpdate", handler: props.onTransformUpdate },
|
|
35
|
+
{ name: "onTrackingUpdated", handler: props.onTrackingUpdated },
|
|
36
|
+
];
|
|
37
|
+
// Register all event handlers and store callback IDs for cleanup
|
|
38
|
+
const registeredCallbacks = eventHandlers
|
|
39
|
+
.filter(({ handler }) => !!handler)
|
|
40
|
+
.map(({ name, handler }) => {
|
|
41
|
+
const callbackId = `${nodeId}_${name}`;
|
|
42
|
+
// Register the callback in the global registry
|
|
43
|
+
if (typeof global !== "undefined" && global.registerViroEventCallback) {
|
|
44
|
+
global.registerViroEventCallback(callbackId, handler);
|
|
45
|
+
}
|
|
46
|
+
// Register with native code
|
|
47
|
+
nativeViro.registerEventCallback(nodeId, name, callbackId);
|
|
48
|
+
return { name, callbackId };
|
|
49
|
+
});
|
|
50
|
+
// Cleanup when unmounting
|
|
51
|
+
return () => {
|
|
52
|
+
const nativeViro = (0, ViroGlobal_1.getNativeViro)();
|
|
53
|
+
if (!nativeViro)
|
|
54
|
+
return;
|
|
55
|
+
// Unregister all event handlers
|
|
56
|
+
registeredCallbacks.forEach(({ name, callbackId }) => {
|
|
57
|
+
nativeViro.unregisterEventCallback(nodeId, name, callbackId);
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
}, [nodeId, props.onTransformUpdate, props.onTrackingUpdated]);
|
|
61
|
+
// Render children with this AR camera as their parent
|
|
62
|
+
return (<ViroUtils_1.ViroContextProvider value={nodeId}>{props.children}</ViroUtils_1.ViroContextProvider>);
|
|
63
|
+
};
|
|
64
|
+
exports.ViroARCamera = ViroARCamera;
|
|
65
|
+
//# sourceMappingURL=ViroARCamera.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViroARCamera.js","sourceRoot":"","sources":["../../components/ViroARCamera.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,kDAA0B;AAC1B,2CAMqB;AACrB,6CAA6C;AAiC7C;;;;GAIG;AACI,MAAM,YAAY,GAAgC,CAAC,KAAK,EAAE,EAAE;IACjE,iEAAiE;IACjE,MAAM,WAAW,GAAG;QAClB,GAAG,IAAA,8BAAkB,EAAC,KAAK,CAAC;QAC5B,MAAM,EAAE,KAAK,CAAC,MA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AE,EAAE,EAAE;gBACnD,UAAU,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;YAC/D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAE/D,sDAAsD;IACtD,OAAO,CACL,CAAC,+BAAmB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,+BAAmB,CAAC,CAC3E,CAAC;AACJ,CAAC,CAAC;AApDW,QAAA,YAAY,gBAoDvB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViroARImageMarker
|
|
3
|
+
*
|
|
4
|
+
* A component for detecting and tracking images in the real world.
|
|
5
|
+
*/
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { ViroCommonProps } from "./ViroUtils";
|
|
8
|
+
export interface ViroARImageMarkerProps extends ViroCommonProps {
|
|
9
|
+
target: string;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
onAnchorFound?: () => void;
|
|
13
|
+
onAnchorUpdated?: () => void;
|
|
14
|
+
onAnchorRemoved?: () => void;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ViroARImageMarker is a component for detecting and tracking images in the real world.
|
|
19
|
+
* It allows you to attach virtual content to real-world images, such as posters, book covers, or logos.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ViroARImageMarker: React.FC<ViroARImageMarkerProps>;
|
|
22
|
+
//# sourceMappingURL=ViroARImageMarker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViroARImageMarker.d.ts","sourceRoot":"","sources":["../../components/ViroARImageMarker.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,eAAe,EAKhB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAE7D,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAG7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA4D9D,CAAC"}
|