This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Oculus Quest OpenVR support #214
Closed
Closed
Changes from 37 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
319844b
All the things needed to get the touch scrolling to work.
StephenHodgson ba271f8
Fixed a regression with registering for events
StephenHodgson 3f0402b
removed always true expression
StephenHodgson fea43b7
Merge branch 'development' into dev-input-updates
StephenHodgson 7d97436
Merge branch 'dev-always-true-expression' into dev-input-updates
StephenHodgson 3cf5e27
updated sdk checkout for input updates
StephenHodgson 2bbd40e
Merge branch 'development' into dev-input-updates
StephenHodgson e613fd2
Merge branch 'development' into dev-input-updates
StephenHodgson 3b22704
ported deadzone fixes
StephenHodgson 44d3a04
Merge branch 'dev-ports' into dev-input-updates
StephenHodgson 088719d
Merge branch 'development' into dev-input-updates
StephenHodgson 7ef3a9b
updated controller popout window to include inverted axes
StephenHodgson a0b0ff2
sdk changes for last commit
StephenHodgson 67306fa
Get the proper SDK checkout
StephenHodgson cd83e51
preliminary scroll support
StephenHodgson fbaafc8
cleaned up focus provider a bit
StephenHodgson 51cb29d
Merge branch 'development' into dev-input-updates
StephenHodgson 648abb1
added is parent or child helper extension
StephenHodgson 0fb3261
default bounds. not new
StephenHodgson 9a4ca8d
added a few more checks just in case
StephenHodgson cc25a8f
Cancel the async stuff if the editor changes playmode states
StephenHodgson 932c9d6
Fix build error
StephenHodgson f3d269d
added a few helper methods to the clipping primitive
StephenHodgson 1429bae
added some parem docs
StephenHodgson 8ce491a
Merge branch 'development' into dev-input-updates
StephenHodgson 4cfa2a1
Merge branch 'development' into dev-input-updates
StephenHodgson 7811254
Fixed common root lookup
StephenHodgson b3c1f6f
Merge branch 'development' into dev-input-updates
StephenHodgson 0ff0ba3
disabled wysisyg
StephenHodgson 76d0458
Merge branch 'development' into dev-input-updates
StephenHodgson 7a99d57
Merge branch 'development' into dev-input-updates
StephenHodgson 5b1656a
Fixed merge conflict
StephenHodgson 61becdd
Initial Update for Oculus support
SimonDarksideJ fd2931a
Merge branch 'dev-input-updates' of https://github.com/XRTK/XRTK-Core…
SimonDarksideJ 56573d7
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ f0c5872
Added missing Menu button
SimonDarksideJ 4c9b413
Merge branch 'development' into OculusSupport
StephenHodgson f45766e
Merge branch 'development' into OculusSupport
StephenHodgson 15516ca
Merge branch 'development' into OculusSupport
StephenHodgson 069938f
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ e098a90
Extended Interaction mapping for 2rd party enum support using strings
SimonDarksideJ 46a53d2
Merge branch 'development' into OculusSupport
StephenHodgson 7d7ea16
Merge branch 'development' of https://github.com/XRTK/XRTK-Core into …
SimonDarksideJ 8dc8934
Fixed outstanding issues. Tested / working
SimonDarksideJ 865a03c
Merge branch 'OculusSupport' of https://github.com/XRTK/XRTK-Core int…
SimonDarksideJ afc71d3
Revert Interaction mapping change back to dev
SimonDarksideJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...kages/com.xrtk.core/Definitions/Controllers/OpenVR/OculusQuestControllerMappingProfile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these copied from the mrtk? |
||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEngine; | ||
using XRTK.Definitions.Devices; | ||
using XRTK.Definitions.Utilities; | ||
|
||
namespace XRTK.Providers.Controllers.OpenVR | ||
{ | ||
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Oculus Quest Controller Mapping Profile", fileName = "OculusQuestControllerMappingProfile")] | ||
public class OculusQuestControllerMappingProfile : BaseMixedRealityControllerMappingProfile | ||
{ | ||
/// <inheritdoc /> | ||
public override SupportedControllerType ControllerType => SupportedControllerType.OculusQuest; | ||
|
||
/// <inheritdoc /> | ||
public override string TexturePath => $"{base.TexturePath}OculusControllersTouch"; | ||
|
||
protected override void Awake() | ||
{ | ||
if (!HasSetupDefaults) | ||
{ | ||
ControllerMappings = new[] | ||
{ | ||
new MixedRealityControllerMapping("Oculus Quest Controller Left", typeof(OculusQuestController), Handedness.Left), | ||
new MixedRealityControllerMapping("Oculus Quest Controller Right", typeof(OculusQuestController), Handedness.Right), | ||
}; | ||
} | ||
|
||
base.Awake(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
.../com.xrtk.core/Definitions/Controllers/OpenVR/OculusQuestControllerMappingProfile.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
...Profiles/DataProviders/Controllers/OpenVR/OculusQuestControllerMappingProfileInspector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEditor; | ||
using XRTK.Inspectors.Profiles; | ||
|
||
namespace XRTK.Providers.Controllers.OpenVR.Inspectors.Profiles | ||
{ | ||
[CustomEditor(typeof(OculusQuestControllerMappingProfile))] | ||
public class OculusQuestControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } | ||
} |
11 changes: 11 additions & 0 deletions
11
...les/DataProviders/Controllers/OpenVR/OculusQuestControllerMappingProfileInspector.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusQuestController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using UnityEngine; | ||
using XRTK.Definitions.Devices; | ||
using XRTK.Definitions.InputSystem; | ||
using XRTK.Definitions.Utilities; | ||
using XRTK.Interfaces.InputSystem; | ||
|
||
namespace XRTK.Providers.Controllers.OpenVR | ||
{ | ||
public class OculusQuestController : GenericOpenVRController | ||
{ | ||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="trackingState"></param> | ||
/// <param name="controllerHandedness"></param> | ||
/// <param name="inputSource"></param> | ||
/// <param name="interactions"></param> | ||
public OculusQuestController(TrackingState trackingState, Handedness controllerHandedness, | ||
IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) | ||
: base(trackingState, controllerHandedness, inputSource, interactions) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[] | ||
{ | ||
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), | ||
new MixedRealityInteractionMapping(1, "Spatial Grip", AxisType.SixDof, DeviceInputType.SpatialGrip, MixedRealityInputAction.None), | ||
new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_9), | ||
new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, KeyCode.JoystickButton14), | ||
new MixedRealityInteractionMapping(4, "Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, DeviceInputType.TriggerNearTouch, ControllerMappingLibrary.AXIS_13), | ||
new MixedRealityInteractionMapping(5, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, DeviceInputType.TriggerPress, ControllerMappingLibrary.AXIS_9), | ||
new MixedRealityInteractionMapping(6, "Axis1D.PrimaryHandTrigger", AxisType.Digital, DeviceInputType.Trigger, KeyCode.JoystickButton4), | ||
new MixedRealityInteractionMapping(7, "Axis1D.PrimaryHandTrigger Press", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_11), | ||
new MixedRealityInteractionMapping(8, "Axis2D.PrimaryThumbstick", AxisType.DualAxis, DeviceInputType.ThumbStick, ControllerMappingLibrary.AXIS_1, ControllerMappingLibrary.AXIS_2), | ||
new MixedRealityInteractionMapping(9, "Button.PrimaryThumbstick Press", AxisType.Digital, DeviceInputType.ThumbStickPress, KeyCode.JoystickButton16), | ||
new MixedRealityInteractionMapping(10, "Button.Three Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton12), | ||
new MixedRealityInteractionMapping(11, "Button.Four Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton13), | ||
new MixedRealityInteractionMapping(12, "Button.Start Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton7), | ||
new MixedRealityInteractionMapping(13, "Thumb Touch", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_15), | ||
new MixedRealityInteractionMapping(14, "Menu Button", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton6) | ||
}; | ||
|
||
/// <inheritdoc /> | ||
public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[] | ||
{ | ||
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), | ||
new MixedRealityInteractionMapping(1, "Spatial Grip", AxisType.SixDof, DeviceInputType.SpatialGrip, MixedRealityInputAction.None), | ||
new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_10), | ||
new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, KeyCode.JoystickButton15), | ||
new MixedRealityInteractionMapping(4, "Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, DeviceInputType.TriggerNearTouch, ControllerMappingLibrary.AXIS_14), | ||
new MixedRealityInteractionMapping(5, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, DeviceInputType.TriggerPress, ControllerMappingLibrary.AXIS_10), | ||
new MixedRealityInteractionMapping(6, "Axis1D.PrimaryHandTrigger", AxisType.Digital, DeviceInputType.Trigger, KeyCode.JoystickButton5), | ||
new MixedRealityInteractionMapping(7, "Axis1D.PrimaryHandTrigger Press", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_11), | ||
new MixedRealityInteractionMapping(8, "Axis2D.PrimaryThumbstick", AxisType.DualAxis, DeviceInputType.ThumbStick, ControllerMappingLibrary.AXIS_4, ControllerMappingLibrary.AXIS_5), | ||
new MixedRealityInteractionMapping(9, "Button.PrimaryThumbstick Press", AxisType.Digital, DeviceInputType.ThumbStickPress, KeyCode.JoystickButton17), | ||
new MixedRealityInteractionMapping(10, "Button.Three Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton10), | ||
new MixedRealityInteractionMapping(11, "Button.Four Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton11), | ||
new MixedRealityInteractionMapping(12, "Button.Start Press", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton7), | ||
new MixedRealityInteractionMapping(13, "Thumb Touch", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_17) | ||
}; | ||
|
||
/// <inheritdoc /> | ||
public override void SetupDefaultInteractions(Handedness controllerHandedness) | ||
{ | ||
AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusQuestController.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,6 +150,7 @@ protected void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMa | |
// If our value was updated, raise it. | ||
if (interactionMapping.Updated) | ||
{ | ||
Debug.LogError($"Interaction updated {interactionMapping.Description} - Value [{interactionMapping.FloatData}]"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these errors here? Just to verify you're getting data? |
||
// Raise input system Event if it enabled | ||
MixedRealityToolkit.InputSystem?.RaiseOnInputPressed(InputSource, ControllerHandedness, interactionMapping.MixedRealityInputAction, interactionMapping.FloatData); | ||
} | ||
|
@@ -176,6 +177,7 @@ protected void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMa | |
// If our value was updated, raise it. | ||
if (interactionMapping.Updated) | ||
{ | ||
Debug.LogError($"Interaction updated {interactionMapping.Description} - Value [{interactionMapping.FloatData}]"); | ||
MixedRealityToolkit.InputSystem?.RaiseOnInputPressed(InputSource, ControllerHandedness, interactionMapping.MixedRealityInputAction, singleAxisValue); | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these copied from the mrtk?