order, title, type, label
| order |
title |
type |
label |
| 6 |
XR Abilities |
XR |
XR |
Galacean XR currently includes the following abilities:
| Ability |
Explanation |
| Anchor Tracking |
Anchor tracking |
| Plane Tracking |
Plane tracking |
| Image Tracking |
Image tracking |
| Hit Test |
Hit test |
Anchor Tracking
| Property |
Explanation |
| trackingAnchors |
(Read-only) Get anchors requested for tracking |
| trackedAnchors |
(Read-only) Get tracked anchors |
| Method |
Explanation |
| addAnchor |
Add a specific anchor |
| removeAnchor |
Remove a specific anchor |
| clearAnchors |
Remove all anchors |
| addChangedListener |
Add a function to listen for anchor changes |
| removeChangedListener |
Remove a function listening for anchor changes |
You can add anchors in XR space with the following code:
Plane Tracking
| Property |
Explanation |
| detectionMode |
(Read-only) Type of planes being tracked, horizontal, vertical, or all |
| trackedPlanes |
(Read-only) Get tracked planes |
| Method |
Explanation |
| addChangedListener |
Add a function to listen for plane changes |
| removeChangedListener |
Remove a function listening for plane changes |
Note that when adding functionality to plane tracking, you need to specify the type of plane tracking.
We can track real-world planes and mark them with transparent grids and coordinate systems:
Image Tracking
| Property |
Explanation |
| trackingImages |
(Read-only) Array of images requested for tracking, including name, source, and size |
| trackedImages |
(Read-only) Get tracked images |
| Method |
Explanation |
| addChangedListener |
Add a function to listen for image changes |
| removeChangedListener |
Remove a function listening for image changes |
Note that when adding functionality to image tracking, you need to specify the images to track, and in WebXR, each image will only be tracked once.
We can track real-world images and mark them with coordinate systems:
Collision Detection
| Method |
Description |
| hitTest |
Collision detection by casting rays in real space |
| screenHitTest |
Collision detection by comparing screen space coordinates with real space planes |