Add ultimate xr
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="UxrValveIndexInput.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using System.Collections.Generic;
|
||||
using UltimateXR.Core;
|
||||
using UltimateXR.Devices.Integrations.SteamVR;
|
||||
|
||||
namespace UltimateXR.Devices.Integrations.Valve
|
||||
{
|
||||
/// <summary>
|
||||
/// Valve index controllers. Also known as Knuckles.
|
||||
/// </summary>
|
||||
public class UxrValveIndexInput : UxrSteamVRControllerInput
|
||||
{
|
||||
#region Public Overrides UxrControllerInput
|
||||
|
||||
/// <inheritdoc />
|
||||
public override UxrControllerSetupType SetupType => UxrControllerSetupType.Dual;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool MainJoystickIsTouchpad => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool HasControllerElements(UxrHandSide handSide, UxrControllerElements controllerElements)
|
||||
{
|
||||
uint validElements = (uint)(UxrControllerElements.Joystick | // Joystick
|
||||
UxrControllerElements.Joystick2 | // Trackpad
|
||||
UxrControllerElements.Grip | // Grip
|
||||
UxrControllerElements.Trigger | // Trigger
|
||||
UxrControllerElements.Button1 | // Button A
|
||||
UxrControllerElements.Button2 | // Button B
|
||||
UxrControllerElements.DPad); // Joystick
|
||||
|
||||
return (validElements & (uint)controllerElements) == (uint)controllerElements;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override UxrControllerInputCapabilities GetControllerCapabilities(UxrHandSide handSide)
|
||||
{
|
||||
return UxrControllerInputCapabilities.HapticImpulses | UxrControllerInputCapabilities.TrackedHandPose;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Overrides UxrSteamVRControllerInput
|
||||
|
||||
/// <inheritdoc />
|
||||
public override IEnumerable<string> ControllerNames
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return "indexcontroller";
|
||||
yield return "Knuckles EV3.0 Left";
|
||||
yield return "Knuckles EV3.0 Right";
|
||||
yield return "Knuckles EV2.0 Left";
|
||||
yield return "Knuckles EV2.0 Right";
|
||||
yield return "Knuckles Left";
|
||||
yield return "Knuckles Right";
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool UsesHandSkeletons => true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Protected Overrides UxrSteamVRControllerInput
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void UpdateInput()
|
||||
{
|
||||
base.UpdateInput();
|
||||
|
||||
// Propagate touchpad touch to press, since only touch is signaled by the API
|
||||
SetButtonFlags(ButtonFlags.PressFlagsLeft, UxrInputButtons.Joystick2, GetButtonsTouch(UxrHandSide.Left, UxrInputButtons.Joystick2));
|
||||
SetButtonFlags(ButtonFlags.PressFlagsRight, UxrInputButtons.Joystick2, GetButtonsTouch(UxrHandSide.Right, UxrInputButtons.Joystick2));
|
||||
|
||||
// Propagate grip touch to press, since only touch is signaled by the API
|
||||
SetButtonFlags(ButtonFlags.PressFlagsLeft, UxrInputButtons.Grip, GetButtonsTouch(UxrHandSide.Left, UxrInputButtons.Grip));
|
||||
SetButtonFlags(ButtonFlags.PressFlagsRight, UxrInputButtons.Grip, GetButtonsTouch(UxrHandSide.Right, UxrInputButtons.Grip));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d38a842ac6135e64babe0def2b78c7f0
|
||||
timeCreated: 1499677449
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="UxrValveIndexTracking.cs" company="VRMADA">
|
||||
// Copyright (c) VRMADA, All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
using System;
|
||||
using UltimateXR.Devices.Integrations.SteamVR;
|
||||
|
||||
namespace UltimateXR.Devices.Integrations.Valve
|
||||
{
|
||||
/// <summary>
|
||||
/// Tracking component for Valve Index controllers, also known as Knuckles, using SteamVR.
|
||||
/// </summary>
|
||||
public class UxrValveIndexTracking : UxrSteamVRControllerTracking
|
||||
{
|
||||
#region Public Overrides UxrControllerTracking
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Type RelatedControllerInputType => typeof(UxrValveIndexInput);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c210797670b3ccb4faa0d527c28face7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user