@reactvision/react-viro 2.55.0 → 2.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/android/react_viro/react_viro-release.aar +0 -0
- package/android/viro_renderer/viro_renderer-release.aar +0 -0
- package/components/AR/ViroARScene.tsx +17 -0
- package/components/AR/ViroARSceneNavigator.tsx +33 -0
- package/components/Utilities/StreamingAudioManager.ts +73 -0
- package/components/Utilities/ViroVersion.ts +1 -1
- package/components/ViroCameraTexture.tsx +230 -0
- package/components/ViroGameLoop.tsx +74 -0
- package/components/ViroGameLoopUtils.ts +52 -0
- package/components/ViroObjectDetector.tsx +222 -0
- package/components/ViroVirtualButton.tsx +101 -0
- package/components/ViroVirtualJoystick.tsx +126 -0
- package/components/hooks/useGameLoop.ts +78 -0
- package/dist/components/AR/ViroARScene.d.ts +12 -0
- package/dist/components/AR/ViroARScene.js +8 -1
- package/dist/components/AR/ViroARSceneNavigator.d.ts +30 -0
- package/dist/components/Utilities/StreamingAudioManager.d.ts +22 -0
- package/dist/components/Utilities/StreamingAudioManager.js +45 -0
- package/dist/components/Utilities/ViroVersion.d.ts +1 -1
- package/dist/components/Utilities/ViroVersion.js +1 -1
- package/dist/components/ViroCameraTexture.d.ts +137 -0
- package/dist/components/ViroCameraTexture.js +170 -0
- package/dist/components/ViroGameLoop.d.ts +31 -0
- package/dist/components/ViroGameLoop.js +31 -0
- package/dist/components/ViroGameLoopUtils.d.ts +26 -0
- package/dist/components/ViroGameLoopUtils.js +44 -0
- package/dist/components/ViroObjectDetector.d.ts +138 -0
- package/dist/components/ViroObjectDetector.js +85 -0
- package/dist/components/ViroVirtualButton.d.ts +76 -0
- package/dist/components/ViroVirtualButton.js +62 -0
- package/dist/components/ViroVirtualJoystick.d.ts +85 -0
- package/dist/components/ViroVirtualJoystick.js +72 -0
- package/dist/components/hooks/useGameLoop.d.ts +34 -0
- package/dist/components/hooks/useGameLoop.js +63 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +20 -2
- package/dist/plugins/withViro.js +2 -15
- package/dist/plugins/withViroAndroid.js +52 -15
- package/dist/plugins/withViroIos.js +0 -6
- package/index.ts +21 -0
- package/ios/ViroReact.podspec +25 -6
- 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/VROARDepthMesh.h +9 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARFrame.h +33 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARFrameiOS.h +26 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARScene.h +15 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSceneDelegateiOS.h +8 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSession.h +7 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARSessioniOS.h +18 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROARWorldMesh.h +111 -8
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROAudioPlayer.h +19 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROAudioPlayerStreamiOS.h +95 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROCameraTextureiOS.h +17 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODriver.h +20 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODynamicGeometry.h +170 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRODynamicMeshNode.h +87 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGLTFLoader.h +5 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROGameLoopListener.h +125 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROInputState.h +133 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROMonocularDepthEstimator.h +73 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROObjectDetector.h +134 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPCMRingBuffer.h +143 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROPencil.h +9 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderContext.h +4 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VRORenderer.h +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROVertexBuffer.h +102 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROViewAR.h +9 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Headers/VROVirtualControllerRegistry.h +106 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Info.plist +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/Shaders.dat +1 -1
- package/ios/dist/ViroRenderer/ViroKit.framework/ViroKit +0 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/constant_fsh.glsl +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/constant_fsh_adreno.glsl +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/standard_fsh.glsl +1 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/standard_vsh.glsl +4 -0
- package/ios/dist/ViroRenderer/ViroKit.framework/standard_vsh_adreno.glsl +4 -0
- package/ios/dist/ViroRendererVisionOS/ViroKit.podspec +27 -0
- package/ios/dist/include/VRTARScene.h +1 -0
- package/ios/dist/include/VRTARSceneNavigator.h +3 -0
- package/ios/dist/include/VRTCameraTexture.h +62 -0
- package/ios/dist/include/VRTCameraTextureManager.h +30 -0
- package/ios/dist/include/VRTCameraTextureModule.h +38 -0
- package/ios/dist/include/VRTGameLoopView.h +19 -0
- package/ios/dist/include/VRTGameLoopViewManager.h +8 -0
- package/ios/dist/include/VRTManagedAnimation.h +67 -0
- package/ios/dist/include/VRTStreamingAudioModule.h +21 -0
- package/ios/dist/include/VRTVirtualButtonView.h +47 -0
- package/ios/dist/include/VRTVirtualButtonViewManager.h +21 -0
- package/ios/dist/include/VRTVirtualJoystickView.h +59 -0
- package/ios/dist/include/VRTVirtualJoystickViewManager.h +26 -0
- package/ios/dist/lib/libViroReact.a +0 -0
- package/package.json +17 -20
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VRTVirtualButtonView.h
|
|
3
|
+
// ViroReact
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2026 ReactVision. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
// a copy of this software and associated documentation files (the
|
|
9
|
+
// "Software"), to deal in the Software without restriction, including
|
|
10
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
// permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
// the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included
|
|
16
|
+
// in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
#import <UIKit/UIKit.h>
|
|
19
|
+
#import <React/RCTComponent.h>
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
Native virtual-button view. Renders a filled circle with a label; on touch-down
|
|
23
|
+
it writes setButton(idx, true) to a VROInputState from VROVirtualControllerRegistry,
|
|
24
|
+
and on touch-up / cancel writes setButton(idx, false).
|
|
25
|
+
|
|
26
|
+
Touch is handled directly on the main thread — no JS bridge round-trip, so
|
|
27
|
+
latency from finger to readable button state is single-digit milliseconds.
|
|
28
|
+
|
|
29
|
+
Used by VRTVirtualButtonViewManager to expose <ViroVirtualButton> to React Native.
|
|
30
|
+
|
|
31
|
+
Properties:
|
|
32
|
+
- controllerId : string. Registry id (e.g. "p1").
|
|
33
|
+
- button : "A" | "B" | "X" | "Y" | "Z" | "L1" | "R1" | "L2" | "R2"
|
|
34
|
+
| "Start" | "Select". Maps to VROInputState::DefaultButton indices.
|
|
35
|
+
- size : CGFloat, default 44. Diameter of the button circle in points.
|
|
36
|
+
- tintColor : UIColor. Default semi-transparent white.
|
|
37
|
+
*/
|
|
38
|
+
@interface VRTVirtualButtonView : UIView
|
|
39
|
+
|
|
40
|
+
@property (nonatomic, copy) NSString *controllerId;
|
|
41
|
+
@property (nonatomic, copy) NSString *button; // e.g. @"A"
|
|
42
|
+
@property (nonatomic, assign) CGFloat size;
|
|
43
|
+
@property (nonatomic, strong) UIColor *tintColor;
|
|
44
|
+
@property (nonatomic, copy) RCTDirectEventBlock onPressIn;
|
|
45
|
+
@property (nonatomic, copy) RCTDirectEventBlock onPressOut;
|
|
46
|
+
|
|
47
|
+
@end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VRTVirtualButtonViewManager.h
|
|
3
|
+
// ViroReact
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2026 ReactVision. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
// a copy of this software and associated documentation files (the
|
|
9
|
+
// "Software"), to deal in the Software without restriction, including
|
|
10
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
// permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
// the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included
|
|
16
|
+
// in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
#import <React/RCTViewManager.h>
|
|
19
|
+
|
|
20
|
+
@interface VRTVirtualButtonViewManager : RCTViewManager
|
|
21
|
+
@end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VRTVirtualJoystickView.h
|
|
3
|
+
// ViroReact
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2026 ReactVision. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
// a copy of this software and associated documentation files (the
|
|
9
|
+
// "Software"), to deal in the Software without restriction, including
|
|
10
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
// permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
// the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included
|
|
16
|
+
// in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
#import <UIKit/UIKit.h>
|
|
19
|
+
#import <React/RCTComponent.h>
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
Native virtual-joystick view. Renders an outer ring and a draggable knob; on
|
|
23
|
+
touch, the knob follows the finger clamped to the outer ring, and the resulting
|
|
24
|
+
normalised stick position is written directly to a VROInputState bound to
|
|
25
|
+
a string controllerId (via VROVirtualControllerRegistry, defined in virocore).
|
|
26
|
+
|
|
27
|
+
Drawing in native UIKit (instead of via React Native <View>) is intentional:
|
|
28
|
+
touch events bypass the JS bridge entirely and update the input state on the
|
|
29
|
+
main thread synchronously. Latency from finger move to readable stick value
|
|
30
|
+
is single-digit milliseconds, vs. 50–80 ms when routing through RN's async
|
|
31
|
+
event path.
|
|
32
|
+
|
|
33
|
+
Used by VRTVirtualJoystickViewManager to expose this view to React Native as
|
|
34
|
+
the <ViroVirtualJoystick> component.
|
|
35
|
+
|
|
36
|
+
Properties (settable from JavaScript via the manager's RCT_EXPORT_VIEW_PROPERTY
|
|
37
|
+
declarations):
|
|
38
|
+
- controllerId : string. Identifies which VROInputState to write to in the
|
|
39
|
+
process-wide VROVirtualControllerRegistry. Multiple
|
|
40
|
+
adapters (this view, a future MFi-gamepad adapter, a tilt
|
|
41
|
+
adapter) can all write to the same id; consumers read the
|
|
42
|
+
aggregated state.
|
|
43
|
+
- stickSide : "left" (default) or "right". Determines whether deflections
|
|
44
|
+
update stickL or stickR on the input state.
|
|
45
|
+
- radius : CGFloat, default 60.0. Outer-ring radius in points; the
|
|
46
|
+
knob is clamped to this distance from the centre.
|
|
47
|
+
- tintColor : UIColor. Default semi-transparent white. Applies to both
|
|
48
|
+
ring stroke and knob fill.
|
|
49
|
+
*/
|
|
50
|
+
@interface VRTVirtualJoystickView : UIView
|
|
51
|
+
|
|
52
|
+
@property (nonatomic, copy) NSString *controllerId;
|
|
53
|
+
@property (nonatomic, copy) NSString *stickSide; // @"left" | @"right"
|
|
54
|
+
@property (nonatomic, assign) CGFloat radius;
|
|
55
|
+
@property (nonatomic, strong) UIColor *tintColor;
|
|
56
|
+
// JS callback fired on every stick move: { x: number, y: number } in [-1, 1]
|
|
57
|
+
@property (nonatomic, copy) RCTDirectEventBlock onStickChange;
|
|
58
|
+
|
|
59
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VRTVirtualJoystickViewManager.h
|
|
3
|
+
// ViroReact
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2026 ReactVision. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
// a copy of this software and associated documentation files (the
|
|
9
|
+
// "Software"), to deal in the Software without restriction, including
|
|
10
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
// permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
// the following conditions:
|
|
14
|
+
//
|
|
15
|
+
// The above copyright notice and this permission notice shall be included
|
|
16
|
+
// in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
#import <React/RCTViewManager.h>
|
|
19
|
+
|
|
20
|
+
/*
|
|
21
|
+
React Native view manager for VRTVirtualJoystickView. Exposes the native
|
|
22
|
+
virtual joystick to JS as the <ViroVirtualJoystick> component. See the view's
|
|
23
|
+
header for the rationale on rendering natively (touch latency).
|
|
24
|
+
*/
|
|
25
|
+
@interface VRTVirtualJoystickViewManager : RCTViewManager
|
|
26
|
+
@end
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "dist/index.js",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.57.0",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
"prepare": "npm run build"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"expo": ">=
|
|
31
|
-
"react
|
|
30
|
+
"expo": ">=55.0.0 <57.0.0",
|
|
31
|
+
"react": ">=18.0.0",
|
|
32
|
+
"react-native": ">=0.83.0 <0.86.0"
|
|
32
33
|
},
|
|
33
34
|
"engines": {
|
|
34
|
-
"react-native": ">=0.
|
|
35
|
+
"react-native": ">=0.83.0 <0.86.0"
|
|
35
36
|
},
|
|
36
37
|
"peerDependenciesMeta": {
|
|
37
38
|
"expo": {
|
|
@@ -56,31 +57,27 @@
|
|
|
56
57
|
"bin",
|
|
57
58
|
"LICENSE"
|
|
58
59
|
],
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@expo/config-plugins": "^9.0.14",
|
|
61
|
-
"react": "~19.2.0",
|
|
62
|
-
"react-native-gradle-plugin": "^0.71.19"
|
|
63
|
-
},
|
|
64
60
|
"devDependencies": {
|
|
65
61
|
"@babel/core": "^7.25.2",
|
|
66
62
|
"@babel/preset-env": "^7.25.3",
|
|
67
63
|
"@babel/preset-typescript": "^7.26.0",
|
|
64
|
+
"@expo/config-plugins": "~56.0.8",
|
|
68
65
|
"@jest/globals": "^29.7.0",
|
|
69
|
-
"@react-native-community/cli": "^
|
|
70
|
-
"@react-native-community/cli-platform-android": "^
|
|
71
|
-
"@react-native-community/cli-platform-ios": "^
|
|
72
|
-
"@react-native/babel-preset": "^0.
|
|
73
|
-
"@react-native/eslint-config": "^0.
|
|
74
|
-
"@react-native/metro-config": "^0.
|
|
75
|
-
"@react-native/typescript-config": "^0.
|
|
66
|
+
"@react-native-community/cli": "^20.1.3",
|
|
67
|
+
"@react-native-community/cli-platform-android": "^20.1.3",
|
|
68
|
+
"@react-native-community/cli-platform-ios": "^20.1.3",
|
|
69
|
+
"@react-native/babel-preset": "^0.85.3",
|
|
70
|
+
"@react-native/eslint-config": "^0.85.3",
|
|
71
|
+
"@react-native/metro-config": "^0.85.3",
|
|
72
|
+
"@react-native/typescript-config": "^0.85.3",
|
|
76
73
|
"@types/babel__core": "^7.20.5",
|
|
77
74
|
"@types/node": "^22.13.1",
|
|
78
|
-
"@types/react": "~19.2.
|
|
79
|
-
"@types/react-native": "^0.73.0",
|
|
75
|
+
"@types/react": "~19.2.17",
|
|
80
76
|
"babel-jest": "^29.7.0",
|
|
81
|
-
"expo": "~
|
|
77
|
+
"expo": "~56.0.9",
|
|
82
78
|
"jest": "^29.7.0",
|
|
83
|
-
"react
|
|
79
|
+
"react": "~19.2.3",
|
|
80
|
+
"react-native": "~0.85.3",
|
|
84
81
|
"release-it": "^17.1.1",
|
|
85
82
|
"ts-node": "^10.9.2",
|
|
86
83
|
"typescript": "^5.3.0"
|