Skip to content

Commit eac1151

Browse files
committed
Added missing Pico2 button
1 parent c0c7b09 commit eac1151

5 files changed

Lines changed: 47 additions & 9 deletions

File tree

Assets/Reign/XRInput/API/Pico2VR.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace Reign.XR.API
99
#if !XRINPUT_DISABLE_PICO2
1010
public sealed class Pico2VR : XRInputAPI
1111
{
12+
private bool handIndexSet;
13+
1214
public override bool GatherInput(XRControllerState[] state_controllers, out int controllerCount, out bool leftSet, out int leftSetIndex, out bool rightSet, out int rightSetIndex, out SideToSet sideToSet)
1315
{
1416
// defaults
@@ -19,8 +21,12 @@ public override bool GatherInput(XRControllerState[] state_controllers, out int
1921
// force hand index
2022
const int leftHandIndex = 0;
2123
const int rightHandIndex = 1;
22-
Controller.UPvr_SetHandNess(Pvr_Controller.UserHandNess.Left);
23-
Controller.UPvr_SetMainHandNess(leftHandIndex);
24+
if (!handIndexSet)
25+
{
26+
handIndexSet = true;
27+
Controller.UPvr_SetHandNess(Pvr_Controller.UserHandNess.Left);
28+
Controller.UPvr_SetMainHandNess(leftHandIndex);
29+
}
2430

2531
// get hand index
2632
//int mainControllerIndex = Controller.UPvr_GetMainHandNess();
@@ -71,6 +77,7 @@ private void GatherInputForController(int controllerIndex, XRControllerSide side
7177
state_controller.buttonTrigger.Update(Controller.UPvr_GetKey(controllerIndex, Pvr_KeyCode.TRIGGER));
7278
bool gripOn = Controller.UPvr_GetKey(controllerIndex, side == XRControllerSide.Right ? Pvr_KeyCode.Right : Pvr_KeyCode.Left);
7379
state_controller.buttonGrip.Update(gripOn);
80+
state_controller.buttonMenu.Update(Controller.UPvr_GetKey(controllerIndex, Pvr_KeyCode.APP));
7481

7582
// analogs
7683
state_controller.trigger.Update(Controller.UPvr_GetControllerTriggerValue(controllerIndex) / 255.0f);

Assets/XR/Settings/Open XR Package Settings.asset

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,7 @@ MonoBehaviour:
14521452
- {fileID: -6208059066966475518}
14531453
- {fileID: -504760844423562565}
14541454
- {fileID: -8333506685063751720}
1455+
- {fileID: 5411322363352526692}
14551456
- {fileID: 3790750328658821260}
14561457
- {fileID: 7984533221296775907}
14571458
- {fileID: 6958787096216914455}
@@ -4543,6 +4544,36 @@ MonoBehaviour:
45434544
company: Oculus
45444545
priority: 0
45454546
required: 0
4547+
--- !u!114 &5411322363352526692
4548+
MonoBehaviour:
4549+
m_ObjectHideFlags: 0
4550+
m_CorrespondingSourceObject: {fileID: 0}
4551+
m_PrefabInstance: {fileID: 0}
4552+
m_PrefabAsset: {fileID: 0}
4553+
m_GameObject: {fileID: 0}
4554+
m_Enabled: 1
4555+
m_EditorHideFlags: 0
4556+
m_Script: {fileID: 11500000, guid: f647cc0545697264a9878224faada6d5, type: 3}
4557+
m_Name: MetaQuestFeature Android
4558+
m_EditorClassIdentifier:
4559+
m_enabled: 0
4560+
nameUi: Meta Quest Support
4561+
version: 1.0.0
4562+
featureIdInternal: com.unity.openxr.feature.metaquest
4563+
openxrExtensionStrings: XR_OCULUS_android_initialize_loader
4564+
company: Unity
4565+
priority: 0
4566+
required: 0
4567+
targetDevices:
4568+
- visibleName: Quest
4569+
manifestName: quest
4570+
enabled: 1
4571+
- visibleName: Quest 2
4572+
manifestName: quest2
4573+
enabled: 1
4574+
- visibleName: Quest Pro
4575+
manifestName: cambria
4576+
enabled: 1
45464577
--- !u!114 &5435099724440967521
45474578
MonoBehaviour:
45484579
m_ObjectHideFlags: 0

Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"com.unity.xr.management": "4.2.1",
2222
"com.unity.xr.mock-hmd": "1.3.1-preview.1",
2323
"com.unity.xr.oculus": "3.2.2",
24-
"com.unity.xr.openxr": "1.5.3",
24+
"com.unity.xr.openxr": "1.6.0",
2525
"com.valvesoftware.unity.openvr": "file:../ExternalPackages/com.valvesoftware.unity.openvr-1.1.4.tgz",
2626
"com.unity.modules.ai": "1.0.0",
2727
"com.unity.modules.androidjni": "1.0.0",

Packages/packages-lock.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"url": "https://packages.unity.com"
144144
},
145145
"com.unity.xr.core-utils": {
146-
"version": "2.0.0",
146+
"version": "2.0.1",
147147
"depth": 2,
148148
"source": "registry",
149149
"dependencies": {
@@ -152,7 +152,7 @@
152152
"url": "https://packages.unity.com"
153153
},
154154
"com.unity.xr.interaction.toolkit": {
155-
"version": "2.0.4",
155+
"version": "2.2.0",
156156
"depth": 1,
157157
"source": "registry",
158158
"dependencies": {
@@ -208,13 +208,13 @@
208208
"url": "https://packages.unity.com"
209209
},
210210
"com.unity.xr.openxr": {
211-
"version": "1.5.3",
211+
"version": "1.6.0",
212212
"depth": 0,
213213
"source": "registry",
214214
"dependencies": {
215215
"com.unity.xr.management": "4.0.1",
216216
"com.unity.xr.legacyinputhelpers": "2.1.2",
217-
"com.unity.inputsystem": "1.4.2"
217+
"com.unity.inputsystem": "1.4.4"
218218
},
219219
"url": "https://packages.unity.com"
220220
},

ProjectSettings/ProjectVersion.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
m_EditorVersion: 2021.3.16f1
2-
m_EditorVersionWithRevision: 2021.3.16f1 (4016570cf34f)
1+
m_EditorVersion: 2021.3.18f1
2+
m_EditorVersionWithRevision: 2021.3.18f1 (3129e69bc0c7)

0 commit comments

Comments
 (0)