Anchor (Beta)
Extension introduces
XR_HTC_anchor allows developers to create an application with anchor/ARPin.
Supported Platforms and Devices
Platform | Headset | Supported | Plugin Version | |
PC | PC Streaming | Focus3/ XR Elite | X | |
Pure PC | Vive Cosmos | X | ||
Vive Pro series | X | |||
AIO | Focus3 | X | ||
XR Elite | V | 2.5.0 and above | ||
Focus Vision | V | 2.5.0 and above |
Enable Plugins
- Edit > Plugins > Search for OpenXR and ViveOpenXR, and make sure they are enabled.
- Note that the " SteamVR " and " OculusVR " plugin must be disabled for OpenXR to work.
- Restart the engine for the changes to take effect.
How to use OpenXR Anchor
- Make sure ViveOpenXR is enabled.
- Select Edit > Project Settings > Plugins > Vive OpenXR > Enable Anchor under Interactive Visual Computing to enable Vive OpenXR anchor extension.
- Restart the engine to apply new settings after clicking Enable Anchor.
- Add the function Start AR Session, and create a AR Session asset to ARSessionConfig.
- For available anchor/ARPin functions, please refer to ARPin.
Export and Import Anchor
We provide the option to export persisted anchors (locally stored ARPins) as binary files. These files can be accessed and shared with other devices.
-
Export All Saved ARPins
This process exports the locally stored ARPins (persisted anchors) to the specified folder.
Ensure that the folder is empty before calling Export All Saved ARPins.
If the folder does not exist, it will be automatically created in the external storage directory.
Once the export is complete, you will receive the full path of the folder containing the persisted anchor binary files -
Import ARPins from folder
This process imports the persisted anchor binary files from the specified folder into local storage and returns them as saved ARPins.
The input folder path can be a full path or a relative path to the external storage directory.
Note that if an ARPin with the same name already exists in local storage, the import of that file will be skipped. -
Export and Import tips
After successfully exporting the ARPins, you will see files named <Your Pin name>.bin in the folder you specified. You can then share the <Your Pin name>.bin files with another HMD device.
On that device, use the import function to import the persisted anchors to local storage. You should then see the same pin positioned in the same space on the new device.
Please do not modify the names of the anchor binary files.
Play the sample map
- Make sure the OpenXR Anchor extension is enabled, the setting is in Edit > Project Settings > Plugins > Vive OpenXR.
-
The sample map is under Content > Anchor > Map.
-
Sample map controls.
Left Thumbstick XY: Move around the map
Right Thumbstick button: Click to open menu, click again to close the menu.
Right Thumbstick Y: Navigate menu up and down.
Rihgt A button: Select menu option.
Right Trigger button: Spawn ARPin.Right Grip button: Press and hold to create a trigger box, erase overlapping ARPins on release.