Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Android oculus support #202

Merged
merged 13 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using UnityEngine;
using XRTK.Definitions.Devices;
using XRTK.Definitions.Utilities;

namespace XRTK.Providers.Controllers.OpenVR
{
Expand All @@ -21,7 +22,7 @@ protected override void Awake()
{
ControllerMappings = new[]
{
new MixedRealityControllerMapping("Oculus Go Controller", typeof(OculusGoController)),
new MixedRealityControllerMapping("Oculus Go Controller", typeof(OculusGoController), Handedness.Both),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,54 @@
false,
false
]
},
{
"Controller": 12,
"Handedness": 3,
"InputLabelPositions": [
{
"x": -101.0,
"y": 306.0
},
{
"x": 329.0,
"y": 439.0
},
{
"x": 328.0,
"y": 415.0
},
{
"x": 329.0,
"y": 463.0
},
{
"x": -16.0,
"y": 117.0
},
{
"x": -90.0,
"y": 175.0
},
{
"x": -90.0,
"y": 220.0
},
{
"x": -90.0,
"y": 198.0
}
],
"IsLabelFlipped": [
true,
false,
false,
false,
true,
true,
true,
true
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ public OculusGoController(TrackingState trackingState, Handedness controllerHand
public override MixedRealityInteractionMapping[] DefaultInteractions => new[]
{
new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None),
new MixedRealityInteractionMapping(1, "Trigger", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton14),
new MixedRealityInteractionMapping(2, "Back", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton6),
new MixedRealityInteractionMapping(3, "PrimaryTouchpad Touch", AxisType.Digital, DeviceInputType.TouchpadTouch, KeyCode.JoystickButton16),
new MixedRealityInteractionMapping(4, "PrimaryTouchpad Click", AxisType.Digital, DeviceInputType.TouchpadPress, KeyCode.JoystickButton8),
new MixedRealityInteractionMapping(5, "PrimaryTouchpad Axis", AxisType.DualAxis, DeviceInputType.DirectionalPad, ControllerMappingLibrary.AXIS_4, ControllerMappingLibrary.AXIS_5)
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 />
/// <inheritdoc />But
public override void SetupDefaultInteractions(Handedness controllerHandedness)
{
AssignControllerMappings(DefaultInteractions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected override GenericJoystickController GetOrAddController(string joystickN
/// <inheritdoc />
protected override SupportedControllerType GetCurrentControllerType(string joystickName)
{
if (string.IsNullOrEmpty(joystickName))
if (string.IsNullOrEmpty(joystickName) || joystickName.Contains("<0"))
{
return SupportedControllerType.None;
}
Expand Down