Hand tracking
Note: you are currently viewing documentation for a beta or an older version of Varjo
Hand tracking with Varjo VR-3 and XR-3 headsets works with Ultraleap Tracking plugin.
Note: Ultraleap Gemini software should not be installed if using VR-3 or XR-3.
Using hand tracking with Ultraleap Tracking plugin
Get Ultraleap Tracking plugin from here.
Follow the Ultraleap documentation to enable and use the plugin in your project.
When you start to develop with hand tracking, make sure to define an offset for the hand position. This is necessary because the head tracking point for your headset differs from the hand tracking point for Ultraleap.
The offsets can be defined in the Leap XR Service Provider component under Advanced Options. Select Manual Head Offset as the Device Offset Mode and set the correct values for Device Offset Y Axis, Device Offset Z Axis and Device Tilt X Axis.
Use the following offset for XR-3 and VR-3:
Y: -0.0112
Z: 0.0999
X tilt: 0
Set hand tracking offsets automatically
Attach the following component next to the Leap XR Service Provider component to handle the offsets automatically depending on the device used.
using UnityEngine;
using UnityEngine.XR;
using Leap.Unity;
[RequireComponent(typeof(LeapXRServiceProvider))]
public class VarjoHandTrackingOffset : MonoBehaviour
{
private InputDevice hmd;
private LeapXRServiceProvider xrServiceProvider;
void Start()
{
hmd = InputDevices.GetDeviceAtXRNode(XRNode.Head);
xrServiceProvider = GetComponent<LeapXRServiceProvider>();
switch (hmd.name)
{
case "XR-3":
case "VR-3":
xrServiceProvider.deviceOffsetMode = LeapXRServiceProvider.DeviceOffsetMode.ManualHeadOffset;
xrServiceProvider.deviceOffsetYAxis = -0.0112f;
xrServiceProvider.deviceOffsetZAxis = 0.0999f;
xrServiceProvider.deviceTiltXAxis = 0f;
break;
case "VR-2 Pro":
xrServiceProvider.deviceOffsetMode = LeapXRServiceProvider.DeviceOffsetMode.ManualHeadOffset;
xrServiceProvider.deviceOffsetYAxis = -0.025734f;
xrServiceProvider.deviceOffsetZAxis = 0.068423f;
xrServiceProvider.deviceTiltXAxis = 5f;
break;
}
}
}