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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial Commit of Oculus Go OpenVR support on Android * Controller visualization now working, updated handedness to support "Any" in configuration. Pointers are not yet however. * Updated comments and improved the Oculus go inspector * CHanged using Any to Both hands. Meaning a controller could be in either hand * Updated missing ref from Any to Both * Finalised testing / configuration for oculus Go OPENVR support * If only for the but..
- Loading branch information
1 parent
9c02702
commit 05970dc
Showing
20 changed files
with
571 additions
and
9 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
...Packages/com.xrtk.core/Definitions/Controllers/OpenVR/OculusGoControllerMappingProfile.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,32 @@ | ||
// Copyright (c) XRTK. 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.Utilities; | ||
|
||
namespace XRTK.Providers.Controllers.OpenVR | ||
{ | ||
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Oculus Go Controller Mapping Profile", fileName = "OculusGoControllerMappingProfile")] | ||
public class OculusGoControllerMappingProfile : BaseMixedRealityControllerMappingProfile | ||
{ | ||
/// <inheritdoc /> | ||
public override SupportedControllerType ControllerType => SupportedControllerType.OculusGo; | ||
|
||
/// <inheritdoc /> | ||
public override string TexturePath => $"{base.TexturePath}OculusGoController"; | ||
|
||
protected override void Awake() | ||
{ | ||
if (!HasSetupDefaults) | ||
{ | ||
ControllerMappings = new[] | ||
{ | ||
new MixedRealityControllerMapping("Oculus Go Controller", typeof(OculusGoController), Handedness.Both), | ||
}; | ||
} | ||
|
||
base.Awake(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ges/com.xrtk.core/Definitions/Controllers/OpenVR/OculusGoControllerMappingProfile.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ public enum SupportedControllerType | |
Xbox, | ||
TouchScreen, | ||
Mouse, | ||
Lumin | ||
Lumin, | ||
OculusGo, | ||
OculusQuest | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
...rs/Profiles/DataProviders/Controllers/OpenVR/OculusGoControllerMappingProfileInspector.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) XRTK. 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(OculusGoControllerMappingProfile))] | ||
public class OculusGoControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } | ||
} |
11 changes: 11 additions & 0 deletions
11
...ofiles/DataProviders/Controllers/OpenVR/OculusGoControllerMappingProfileInspector.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
45 changes: 45 additions & 0 deletions
45
XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoController.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,45 @@ | ||
// Copyright (c) XRTK. 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 OculusGoController : GenericOpenVRController | ||
{ | ||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="trackingState"></param> | ||
/// <param name="controllerHandedness"></param> | ||
/// <param name="inputSource"></param> | ||
/// <param name="interactions"></param> | ||
public OculusGoController(TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) | ||
: base(trackingState, controllerHandedness, inputSource, interactions) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override MixedRealityInteractionMapping[] DefaultInteractions => new[] | ||
{ | ||
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), | ||
new MixedRealityInteractionMapping(1, "Trigger Position", AxisType.SingleAxis, DeviceInputType.Trigger, ControllerMappingLibrary.AXIS_10), | ||
new MixedRealityInteractionMapping(2, "Trigger Press", AxisType.Digital, DeviceInputType.TriggerPress, KeyCode.JoystickButton15), | ||
new MixedRealityInteractionMapping(3, "Trigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, ControllerMappingLibrary.AXIS_10), | ||
new MixedRealityInteractionMapping(4, "Back", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton7), | ||
new MixedRealityInteractionMapping(5, "PrimaryTouchpad Touch", AxisType.Digital, DeviceInputType.TouchpadTouch, KeyCode.JoystickButton17), | ||
new MixedRealityInteractionMapping(6, "PrimaryTouchpad Click", AxisType.Digital, DeviceInputType.TouchpadPress, KeyCode.JoystickButton9), | ||
new MixedRealityInteractionMapping(7, "PrimaryTouchpad Axis", AxisType.DualAxis, DeviceInputType.DirectionalPad, ControllerMappingLibrary.AXIS_4, ControllerMappingLibrary.AXIS_5) | ||
}; | ||
|
||
/// <inheritdoc /> | ||
public override void SetupDefaultInteractions(Handedness controllerHandedness) | ||
{ | ||
AssignControllerMappings(DefaultInteractions); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoController.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
Binary file added
BIN
+48.2 KB
...ore/Packages/com.xrtk.core/StandardAssets/Textures/OculusGoController_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions
90
XRTK-Core/Packages/com.xrtk.core/StandardAssets/Textures/OculusGoController_black.png.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+48.2 KB
...kages/com.xrtk.core/StandardAssets/Textures/OculusGoController_black_scaled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.