Skip to content

Web AR: point cloud props, FeaturePoint hits, Studio fallback to a feature point - #634

Merged
doranteseduardo merged 2 commits into
developfrom
fix/web-ar-tracker
Nov 26, 2026
Merged

doranteseduardo merged 2 commits into
developfrom
fix/web-ar-tracker

Conversation

@doranteseduardo

Copy link
Copy Markdown
Member

Summary

The web half of parity items 20 and 43: onARPointCloudUpdate and displayPointCloud on ViroARScene, FeaturePoint hit results, and Studio's web player placing on a feature point when a tap misses every plane, as the native host does. The tracker fixes behind it (surfaces in metres, ids through a loss) arrive through the renderer, with nothing to change here.

What changed

Point cloud (components/Web/viroPointCloud.ts)

  • useViroPointCloud turns the session's point reads on while either prop is set, and off when neither is.
  • onARPointCloudUpdate fires every frame there are points, in native's shape: points as [x, y, z, confidence] (confidence 1; the web tracker has none) and identifiers. The tracker only gives points once its scale is metric, so the callback stays quiet until then.
  • displayPointCloud asks the renderer to draw the points, with imageSource (loaded into a texture), imageScale and maxPoints; it stops drawing and frees the texture on unmount.
  • Against a renderer without the point cloud, both props warn once and do nothing.

Hit tests

  • featurePointHitResult builds a FeaturePoint result (no anchor, rotation zero).
  • ViroARScene's hit tests map the session's feature-point hits to it beside the plane hits.
  • StudioARScene.web's pickBestHit falls back to FeaturePoint after ExistingPlaneUsingExtent and ExistingPlane, the native host's order without depth points, which the web does not have.

Tracking reasons

No change here: the renderer now reports a tracked frame with excessive motion, too few features or too little light as Limited, so onTrackingUpdated gets TRACKING_LIMITED with that reason, as on iOS.

Related

Testing

  • npx tsc --noEmit is clean; npx jest: 1261 tests pass.
  • New webPointCloud.test.tsx: the payload is native's shape; a feature-point result has no anchor; the hook enables reads only while a prop wants them, reports points each frame once there are any, and starts and stops the renderer's display.

@doranteseduardo
doranteseduardo merged commit 74f6481 into develop Nov 26, 2026
1 check passed
@doranteseduardo
doranteseduardo deleted the fix/web-ar-tracker branch November 26, 2026 02:08
@doranteseduardo doranteseduardo mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants