Example of the newly added WebXRPlaneTracking?

Does this visualise planes in AR? I am upgrading some old projects to 3.* Needle so wondering if I need to alter an AR Controls project I made with draggable objects

Original Post on Discord

by user 103054507105067008

It can visualize planes in AR yes, if you add a template to the slot here it will be used for visualization (you can also add components on the template). You can also subscribe to the plane-updated event to get the XRPlanes and created meshes

e.g. webXRPlaneTracking.addEventListener("plane-updated", evt : CustomEvent<WebXRPlaneTrackingEvent> => {

This is super useful! Will see if I can start raycasting against them which I assume can be done? For now I had a very large ground plane I spawned as a hack

by user 103054507105067008

Yes you can raycast against them. You can also use the physics raycasts if you want (and if your Template has a MeshCollider)

Note that some devices support plane tracking while others only support hit testing and vice versa - still not super easy to just say “place an object on a surface”

Is there any reference to what devices do and don’t support it? I assume if they don’t support it they don’t support ARCore/ARKit?

by user 103054507105067008

probably yes. I’m not aware of a full reference. Typically you’ll want to use feature detection (as we’re doing) by specifying certain things as optional (e.g. both plane-tracking and hit-testing)

We do plan to unify this more though so that you don’t have to worry about it - I’d recommend to use hit-testing as the “wider supported” option for now