// --------------------------------------------------------------------------------------------------------------------
//
// Copyright (c) VRMADA, All rights reserved.
//
// --------------------------------------------------------------------------------------------------------------------
using System.Collections.Generic;
using UltimateXR.Core;
namespace UltimateXR.Devices.Integrations.Oculus
{
///
/// Oculus Touch controller input using Oculus SDK.
///
public class UxrOculusTouchRiftInput : UxrUnityXRControllerInput
{
#region Public Overrides UxrControllerInput
///
/// Gets the SDK dependency: Oculus SDK.
///
public override string SDKDependency => UxrConstants.SdkOculus;
///
public override UxrControllerSetupType SetupType => UxrControllerSetupType.Dual;
///
public override bool IsHandednessSupported => true;
///
public override bool MainJoystickIsTouchpad => false;
///
public override bool HasControllerElements(UxrHandSide handSide, UxrControllerElements controllerElements)
{
uint validElements = (uint)(UxrControllerElements.Joystick |
UxrControllerElements.Grip |
UxrControllerElements.Trigger |
UxrControllerElements.ThumbCapSense |
UxrControllerElements.Button1 |
UxrControllerElements.Button2 |
UxrControllerElements.Menu |
UxrControllerElements.DPad);
if (handSide == UxrHandSide.Right)
{
// Remove menu button from right controller, which is reserved.
validElements = validElements & ~(uint)UxrControllerElements.Menu;
}
return (validElements & (uint)controllerElements) == (uint)controllerElements;
}
#endregion
#region Public Overrides UxrUnityXRControllerInput
///
public override IEnumerable ControllerNames
{
get
{
if (UxrTrackingDevice.HeadsetDeviceName == "Oculus Rift CV1")
{
yield return "Oculus Touch Controller - Left";
yield return "Oculus Touch Controller - Right";
}
}
}
#endregion
}
}