// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using System.Collections.Generic;
using UltimateXR.Core;
using UnityEngine;
namespace UltimateXR.Devices.Integrations.Microsoft
{
///
/// Windows Mixed Reality input using Unity XR.
///
public class UxrWindowsMixedRealityInput : UxrUnityXRControllerInput
{
#region Inspector Properties/Serialized Fields
[Header("Windows Mixed Reality:")] [SerializeField] private float _joystickDeadZone = 0.15f;
#endregion
#region Public Overrides UxrControllerInput
///
/// Requires WMR SDK using OpenXR.
///
public override string SDKDependency => UxrConstants.SdkWindowsMixedReality;
///
public override UxrControllerSetupType SetupType => UxrControllerSetupType.Dual;
///
public override bool IsHandednessSupported => true;
///
public override float JoystickDeadZone => _joystickDeadZone;
///
public override bool HasControllerElements(UxrHandSide handSide, UxrControllerElements controllerElements)
{
uint validElements = (uint)(UxrControllerElements.Joystick |
UxrControllerElements.Joystick2 |
UxrControllerElements.Grip |
UxrControllerElements.Trigger |
UxrControllerElements.Menu |
UxrControllerElements.DPad);
return (validElements & (uint)controllerElements) == (uint)controllerElements;
}
#endregion
#region Public Overrides UxrUnityXRControllerInput
///
public override IEnumerable ControllerNames
{
get
{
yield return "Windows MR Controller";
yield return "Windows MR Controller OpenXR";
}
}
#endregion
}
}