XRShared

Fusion XR prototyping addons

The XRShared addon provides the base component to create a XR experience compatible with Fusion.

Architecture and detailed explanation

The logic to build the same components than the one provided in this addon is described in the VR Shared sample, with in-depth explanations of the choices.

Features

Rig logic: hardware and network rig

See Rigs, in VRShared samples for concepts

The following script are used to collect the position of the various rig parts (headset, left hand, right hand, rig root):

  • HardwareRig
  • HardwareHeadset
  • HardwareHand

Then, their corresponding network script collect for the local user the position/rotation data provided by the hardware script, and synchronize them to all players:

  • NetworkRig
  • NetworkHeadset
  • NetworkHand

Basic hand state (index, thumb and grabbing position) are also synchronized in the hand script.

fusion vr shared rigs logic

Grabbing

Basic grabbing functionality is demonstrated in the addon. Two approaches are available.

fusion vr shared grab

Network hand-based grabbing

See Grabbing in the VR Shared sampple, for the concept of a fully network-based grabbing

In this approach, the hovering detection over a grabbable is done with the network hand's colliders.

The grabbable object must have a NetworkHandColliderGrabbable component, and the NetworkHand a NetworkHandColliderGrabber component.

Hardware hand-based grabbing

See the dedicated Local rig grabbing page, for an approach where the grabbing is initiated by the hardware rig

In this approach, the hovering is detected on the hardware hand's colliders, and can also be used for non-networked objects.

For non-networked grabbing, the grabbable object must have a Grabbable , and the hardware hand a GrabberComponent

For networked grabbing, in addition to those previous components, the grabbable object must also have a NetworkGrabbable component, and the NetworkHand a NetworkGrabber component.

Locomotion

See Teleport & locomotion for details

The addon demonstrates basic locomotion, with simple teleportation.

The RayBeamer class displays a line renderer-based beam, and upon release, the RigLocomotion place next to the HardwareRig triggers the rig movement. The RigLocomotion scripts also handles snap rotation.

fusion vr shared teleport

Demo

A demo scene can be found in Assets\Photon\FusionAddons\XRShared\Demo\Scenes\ folder.

Download

This addon latest version is included into the XR addon project

Supported topologies

  • shared mode

Changelog

  • Version 2.0.2:
    • Ensure compatibility with Unity 2021.x (box colliders, edited in 2022.x, in prefab had an improper size when opened in 2021.x)
    • Add layer utils to simplify automatic configuration of layers between projects
  • Version 2.0.1: Add VolumeCamera handling in HideForLocalUser if Polyspatial is installed
  • Version 2.0.0: First release
Back to top