ViroReact 3.2.1: placed content stays put, cloud anchors and Android fixes
Content placed at the root of an AR scene stays put: every direct child of ViroARScene is now anchored on iOS, as it already was on Android, and on Android it waits for tracking instead of giving up. Tracking no longer flickers on phones such as the Galaxy A56, reactvision cloud anchors host on a slow uplink and can be followed on Android, release builds with R8 pass, and an AR scene hidden by a tab switch no longer crashes on a queued call. Renderer binaries are rebuilt on virocore 3.2.1 with ReactVision Spatial 1.5.0, and the web build still uses @reactvision/viro-web-renderer 1.1.1. There are no new requirements: 3.2.1 needs React Native 0.88 and Expo SDK 58, like 3.2.0. Read Check when upgrading before you update.
Everywhere
- A tap on a moving node fires
onClick. A node that moved during the press (an animation, physics, the camera) gotonClickStatedown and up but noonClick. A short tap that barely moves now completes the click on the pressed node. See ViroNode. - A node faded by its parent's
opacityno longer hides translucent content behind it, such as text or another faded object. Its children were drawn as opaque and wrote depth.
iOS
- Content placed at the root of an AR scene stays put as ARKit refines its map. Each direct child of
ViroARSceneis anchored with an ARKit anchor once tracking is NORMAL, as on Android. Itsposition, animations, drag and physics keep working in scene coordinates. Anchors, markers, planes andViroVPSAnchorare left alone. See ViroARScene. ViroARObjectMarkerfires when its object is detected. Object anchors were dropped on every current iOS version, so an object marker never fired. An.arobjectthat fails to load is now skipped with a warning instead of crashing the app. See ViroARObjectMarker.
Android
- Tracking no longer flickers on phones that could not sustain Viro's camera config (#568). On some mid-range phones, such as the Galaxy A56,
onTrackingUpdatedalternated between UNAVAILABLE and NORMAL about ten times a second and no plane lasted. The camera config is now capped at 1920×1080 at 30 fps, a paused plane is kept instead of removed, and UNAVAILABLE reachesonTrackingUpdatedafter about 200 ms. - A node at the root of an AR scene anchors once tracking starts, however long that takes. When tracking took more than about three seconds to start (a dim room, a covered camera, fast motion), the node used up its three tries and floated for the session. A position set on the node while it waits is now the one it anchors at.
- A release build with R8 minification passes. Viro's consumer rules tell R8 to ignore the protobuf and VR logging classes the bundled GVR SDK references but does not ship (
Missing classes detected while running R8). Expo SDK 58's Android template turns minification on, so an app on it hit this on its first release build. Nothing changes at runtime. - An AR scene method called while its screen is hidden answers
AR scene not availableinstead of crashing. A tab switch or a screen pushed on top tears the scene down without unmounting it, and a queued call such as agetCameraGeospatialPosepoll crashed the app. - Hosting a cloud anchor with the
reactvisionprovider no longer fails on a slow uplink. The upload timed out after 30 s even while it was still sending. The timeout now grows with the upload, up to 140 s, and a failed upload is sent once more. - Content can follow a cloud anchor resolved with the
reactvisionprovider. The resolve result is now an ARCore anchor:onAnchorUpdatedonViroARScenereports it underanchor.anchorId, and the children of<ViroARPlane anchorId={anchor.anchorId}>move with it, so content stays on the real spot after ARCore relocalises. Content placed fromanchor.positionalone still does not move. See Cloud Anchors.
ReactVision Spatial
- Cloud anchor resolve reports are accurate. The report sent after a resolve carries the attempt's real match and inlier counts and why it failed or was cancelled, and hosting sends the device and the descriptor format, so the dashboard's numbers are right.
Check when upgrading
- Android: a
reactvisionresolve result'sanchor.anchorIdis now the ARCore anchor's id.cloudAnchorIdis unchanged. An app that stored the oldanchorIdsees a different value. - Android: UNAVAILABLE from
onTrackingUpdatedarrives about 200 ms after tracking drops, not on the first frame. NORMAL is still reported at once. ViroARScene.createAnchoredNodereturns an anchor nothing can be attached to. To keep placed content in place, render it as a direct child ofViroARScene. See ViroARScene.
Install with npm install @reactvision/[email protected]. Upgrading from 3.1.x? Read Upgrading to 3.2.0 first. Full notes: ReactVision/viro v3.2.1.