HomeGuidesAPI ReferenceChangelogDiscussions
Hire a ReactVision Expert 🛠️Launch Studio 🖥️Sponsor on GitHub ❤️Log In
Changelog
added

ViroReact 3.4.0: Quest one-shot sounds, hand joints and recording, animation commands and AR depth maps

On Meta Quest, one-shot sounds play with no component mounted for each cue, onHandUpdate reports 25 named joints per hand, the passthrough camera records sessions and finds image markers, and exitVRScene() says what it did. ViroGameLoopUtils plays and stops animations without a React render on every platform, web included, and a reset returns a model to the pose it loaded in. AR sessions report why they could not start, the depth map can be read from JavaScript, and recordings gain low-light options and per-frame camera conditions for ReactVision Scan. Built on virocore 3.4.0, with no new requirements: React Native 0.88 and Expo SDK 58, as before. The web build works with @reactvision/viro-web-renderer 1.4.0 or later.

Meta Quest

  • ViroSound.playOneShot and ViroSpatialSound.playOneShot play a clip preloaded with ViroSound.preloadSounds once, positioned or head-locked, with nothing mounted. The clip is decoded once and played from memory, with nothing on the main thread, so a game with many cues no longer lags. They play on iOS too; on visionOS and the web they resolve false. See ViroSound.
  • onHandUpdate on ViroXRSceneNavigator is called: 25 named joints per hand in scene coordinates, with a radius each, up to 30 times a second. Nothing is computed while the prop is unset. See ViroXRSceneNavigator.
  • Session recording from the passthrough camera. startRecording / stopRecording on the navigator ref in mixed-reality scenes, with the same files as on a phone (no depth). See AR Session Recording.
  • ViroARImageMarker and Editor scenes' image-triggered content work on the headset, found in the passthrough camera's frames. Editor scenes on the free plan show their watermark in the headset view.
  • exitVRScene() resolves with { finished, panel } and takes { panel: "direct" } to start the panel itself. It no longer does nothing in silence when it cannot find the headset view. See HorizonOS Setup Guide.
  • Controllers and activities. Controller ray requests always settle, and reject with E_CONTROLLER_NOT_READY or E_CONTROLLER_TIMEOUT instead of crashing or hanging. An older ViroController gets events back when a newer one is torn down, and the menu button reaches the scene. A finishing headset view no longer answers the next one, and launchVRScene waits for it. See ViroController.

Animation

  • ViroGameLoopUtils.playAnimation and stopAnimation play, switch or stop a node's animation with no React render, on Android, iOS, visionOS and the web. Use them for a character that changes clip many times a second; the animation prop is still the tool for an animation set once. See ViroGameLoop.
  • stopAnimation({ mode: "reset" }) returns a model to the pose it loaded in, morph targets and skeleton included.
  • Android: an animation prop set again with equal values is left alone, instead of restarting or logging Unable to play animation in state RUNNING.

AR

  • onARSessionError on ViroARSceneNavigator says why the session could not start: each ARCore startup failure on Android, an unsupported device or a denied camera on iOS. See ViroARSceneNavigator.
  • getDepthMap() returns the current frame's depth in metres, with confidence, intrinsics and the camera pose, from LiDAR, the monocular estimator or ARCore's Depth API. See ViroARSceneNavigator.
  • Scans in low light. startRecording takes maxExposure, torch, codec, bitrate and stills; getCaptureConditions() tells a scan screen when to ask for more light or slower movement; every recording logs each frame's exposure, light and tracking; and startScanCapture / stopScanCapture make room and object captures for ReactVision Scan. See AR Session Recording.
  • ViroObjectDetector takes an https:// model, downloaded once and cached on the device. See ViroObjectDetector.
  • ViroPhysicsReplicator shares physics bodies across devices over a ViroReplicationClient: the device holding a body's claim simulates it, and the others follow its samples. See Co-Location.

Android

  • shaderModifiers and materialUniforms as node props, and drag, pinch and rotate on the scene root, as on iOS. See Shaders.
  • ViroSound.preloadSounds loads bundled sounds in a release build.

Web

  • ViroGameLoopUtils.setPosition, setRotation and setScale no longer throw, so useViroMapCamera works.
  • One-time warnings for scenes that cannot work as written: an unwired ViroARPlaneSelector, malformed transforms, an unknown physics body type, a ViroText too small to read, and a body that has fallen out of the world. See the Web Setup Guide.

Types and docs

  • A three-argument onCollision handler type-checks; bloomThreshold on a particle image is optional; a Compound physics shape needs no params.
  • physicsBody.velocity is documented as a constant velocity, reasserted every step. To launch or throw a body, use setVelocity or applyImpulse. See Physics.

Check when upgrading

  • Quest one-shots, recording and image markers: one-shots need ViroSound.preloadSounds first. Recording and image markers on the headset need Quest 3 or 3S, Horizon OS v74 or later, and CAMERA and horizonos.permission.HEADSET_CAMERA granted at runtime.
  • exitVRScene() returns a promise. Code that ignored the return value is unaffected.
  • Android: controller ray requests can now reject. Wrap early calls to getControllerRayAsync and getControllerForwardAsync in try / catch.

See Upgrading to 3.2.0 for the upgrade notes, and the GitHub releases for ViroReact 3.4.0 and viro-web-renderer 1.4.1.