Copyright 2023 - 2024, HTC Corporation. All rights reserved.
Shared Space Experience is an MR co-location example for VIVE XR Elite. This example shows how to allow users to interact in the same physical and virtual space.
In this project, we demonstrate how to align the space between two VIVE XR Elites by Trackable Marker and Spatial Anchor.
- Hardware
- 2 or more VIVE XR Elites
- System version: 1.0.999.624 or newer
- 1 pair of VIVE Controllers for XR Series for each VIVE XR Elite
- An ArUco Marker (dictionary: 4x4, ID: 0 ~ 99) for Trackable Marker
- 2 or more VIVE XR Elites
- Software
- Unity Editor 2022.3.1f1 or newer
- Unity Packages:
- VIVE Wave XR Plugin 6.0.0-r.14 or newer
- Netcode for GameObjects: 1.7.0 or newer
- Netcode for GameObjects Community Extensions: 1.0.1 or newer
- Unity Input System: 1.6.3 or newer
- TextMeshPro: 3.0.6 or newer
- Unity Assets:
- KF Magic Effets Free: 1.1.1 or newer
-
Create a new Unity 3D project and switch build platform to
Android
. -
Install and setup WaveXR Plugin.
- Follow Wave Unity SDK -- Getting Started to setup WaveXR in Unity.
- Follow Wave Unity SDK -- Unity Marker to setup Trackable Marker.
- Follow Wave Unity SDK -- Unity Scene Perception to setup Spatial Anchor.
-
Install following packages and assets:
-
Import this project and setup build settings.
- Add the scenes
Launcher
andShootingGame
to theScenes In Build
, and setLauncher
to be the entry scene. - If the
NetworkPrefabsLists
inNetworkManager
component is missing, assign it withAssets/DefaultNetworkPrefabs
.
- Add the scenes
- Environment Setup
- Do
Room Setup
and make sure both VIVE XR Elites have the same floor height. - Place the ArUco marker in a fixed place.
- Do
- Install the App
- Build the project and install the APK on VIVE XR Elites by Android Debug Bridge.
- Play the Game
- Matching
- In the launcher, you can choose to be a host or join others as a client. Maker sure all the VIVE XR Elites connect to the same local network.
- Aligning Space
- The host can decide which align method to use.
- Trackable Marker:
- The host have to scan the markers and select one for alignment.
- The clients scans the same marker to align the space.
- Spatial Anchor:
- The host first create a spatial anchor with the right controller.
- The client then download the spatial anchor. The anchor will relocate and align the space automatically.
- Trackable Marker:
- If the menu is not in a proper place, hold grip button of the left controller to adjust the menu position.
- Once the alignment is completed, players can see each other's virtual controller models and check whether the space has been properly aligned.
- The host can decide which align method to use.
- Playing
- The host can start the game once all the players are aligned and ready.
- The game is a simple PvP shooting game that the player wins by shooting down all the health bricks of other players.
- Attack: Press the trigger on the right controller to shoot magic orbs. Press the grip button can change orb type.
- Defense: Use the shield attached on the left controller to protect the health bricks.
- Matching
-
Co-location -- Trackable Marker and Spatial Anchor:
- Scripts under
Assets/SharedSpaceExperience/Alignment
demonstrate how to align the space by Trackable Marker and Spatial Anchor.MarkerManager.cs
: Demonstrates how to detect markers and retrieve their information.SpatialManager.cs
: Demonstrates how to create and import/export spatial anchor.AlignmentManager.cs
: Demonstrates how to align the space between the host and other players.
- See Wave Unity SDK -- Unity Marker and Wave Unity SDK -- Unity Scene Perception for more information about Trackable Markers and Spatial Anchor.
- Scripts under
-
MR Pass through:
PassThrough.cs
: Demonstrates how to enable pass through mode.- See Wave Unity SDK -- Passthrough for more information.
The third part packages and assets are not included in this repo.
See LICENSE.pdf for more information.
Email: [email protected]