Skip to content

Commit 21f1333

Browse files
committed
Android XR Unity Extensions v0.9.1
1 parent 6c28167 commit 21f1333

16 files changed

+343
-203
lines changed

Assets/Banner.png.meta

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/iconBG.png.meta

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/iconFG.png.meta

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
88
and this package adheres to
99
[Semantic Versioning](http://semver.org/spec/v2.0.0.html).
1010

11+
## [0.9.1] - 2025-04-03
12+
13+
### Added
14+
* New Sample **XRController** which syncs and displays Samsung Controller
15+
16+
### Changed
17+
* N/A
18+
19+
### Deprecated
20+
* N/A
21+
22+
### Removed
23+
* N/A
24+
25+
### Fixed
26+
* Updated Android XR permissions.
27+
1128
## [0.9.0] - 2024-12-12
1229

1330
This is the first release of **Android XR Extensions for Unity

Editor/Internal/XRSessionFeatureBuildHooks.cs

+38-8
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ internal class XRSessionFeatureBuildHooks : OpenXRFeatureBuildHooks
8989
{ "value", "ACTIVITY_START_MODE_UNMANAGED_FULL_SPACE" }
9090
}
9191
};
92+
private static readonly ManifestElement _libopenxrso =
93+
new ManifestElement()
94+
{
95+
ElementPath = new List<string>
96+
{
97+
"manifest", "application", "uses-native-library"
98+
},
99+
Attributes = new Dictionary<string, string>
100+
{
101+
{ "name", "libopenxr.google.so" },
102+
{ "required", "false" }
103+
}
104+
};
92105
#endif // XR_MGMT_4_4_0_OR_NEWER
93106

94107
/// <inheritdoc/>
@@ -172,20 +185,28 @@ public override ManifestRequirement ProvideManifestRequirement()
172185
Debug.Log(stringBuilder);
173186
}
174187

175-
if (CheckSceneUnderstandingPermission())
188+
if (CheckSceneUnderstandingCoarsePermission())
176189
{
177190
requiredManifest.Add(
178-
GetAndroidXRPermissionElement(AndroidXRPermission.SceneUnderstanding));
191+
GetAndroidXRPermissionElement(AndroidXRPermission.SceneUnderstandingCoarse));
179192
Debug.LogFormat("Inject permission manifest: {0}",
180-
AndroidXRPermission.SceneUnderstanding.ToPermissionString());
193+
AndroidXRPermission.SceneUnderstandingCoarse.ToPermissionString());
181194
}
182195

183-
if (CheckEyeTrackingPermission())
196+
if (CheckSceneUnderstandingFinePermission())
184197
{
185198
requiredManifest.Add(
186-
GetAndroidXRPermissionElement(AndroidXRPermission.EyeTracking));
199+
GetAndroidXRPermissionElement(AndroidXRPermission.SceneUnderstandingFine));
187200
Debug.LogFormat("Inject permission manifest: {0}",
188-
AndroidXRPermission.EyeTracking.ToPermissionString());
201+
AndroidXRPermission.SceneUnderstandingFine.ToPermissionString());
202+
}
203+
204+
if (CheckEyeTrackingCoarsePermission())
205+
{
206+
requiredManifest.Add(
207+
GetAndroidXRPermissionElement(AndroidXRPermission.EyeTrackingCoarse));
208+
Debug.LogFormat("Inject permission manifest: {0}",
209+
AndroidXRPermission.EyeTrackingCoarse.ToPermissionString());
189210
}
190211

191212
if (CheckEyeTrackingFinePermission())
@@ -204,6 +225,9 @@ public override ManifestRequirement ProvideManifestRequirement()
204225
AndroidXRPermission.HandTracking.ToPermissionString());
205226
}
206227

228+
requiredManifest.Add(_libopenxrso);
229+
Debug.LogFormat("Inject native library manifest: libopenxr.google.so");
230+
207231
List<ManifestElement> emptyElement = new List<ManifestElement>();
208232
return new ManifestRequirement
209233
{
@@ -230,7 +254,7 @@ private static ManifestElement GetAndroidXRPermissionElement(AndroidXRPermission
230254
};
231255
}
232256

233-
private bool CheckSceneUnderstandingPermission()
257+
private bool CheckSceneUnderstandingCoarsePermission()
234258
{
235259
XRTrackableFeature trackableFeature =
236260
AndroidXRBuildUtils.GetActiveFeature<XRTrackableFeature>();
@@ -265,7 +289,13 @@ private bool CheckSceneUnderstandingPermission()
265289
(anchorFeature != null && anchorFeature.enabled);
266290
}
267291

268-
private bool CheckEyeTrackingPermission()
292+
private bool CheckSceneUnderstandingFinePermission()
293+
{
294+
/// Add check for scene understanding when implemented.
295+
return false;
296+
}
297+
298+
private bool CheckEyeTrackingCoarsePermission()
269299
{
270300
FoveatedRenderingFeature foveatedRendering =
271301
AndroidXRBuildUtils.GetActiveFeature<FoveatedRenderingFeature>();

Runtime/AndroidXRPermissionExtensions.cs

+17-9
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,29 @@ namespace Google.XR.Extensions
2727
public enum AndroidXRPermission
2828
{
2929
/// <summary>
30-
/// Permission to enable scene understanding features that relies on motion tracking,
30+
/// Permission to enable coarse scene understanding features that relies on motion tracking,
3131
/// ToF sensor, and the VST RGB-left cameras.
3232
/// </summary>
33-
SceneUnderstanding,
33+
SceneUnderstandingCoarse,
34+
35+
/// <summary>
36+
/// Permission to enable fine scene understanding features that relies on motion tracking,
37+
/// such as depth texture and scene meshing.
38+
/// </summary>
39+
SceneUnderstandingFine,
3440

3541
/// <summary>
3642
/// Permission to enable hand tracking.
3743
/// </summary>
3844
HandTracking,
3945

4046
/// <summary>
41-
/// Permission to enable eye tracking.
47+
/// Permission to enable coarse eye tracking.
4248
/// </summary>
43-
EyeTracking,
49+
EyeTrackingCoarse,
4450

4551
/// <summary>
46-
/// Permission to enable eye gaze interaction.
52+
/// Permission to enable eye gaze interaction and fine eye tracking.
4753
/// </summary>
4854
EyeTrackingFine,
4955

@@ -68,12 +74,14 @@ public static string ToPermissionString(this AndroidXRPermission permission)
6874
{
6975
switch (permission)
7076
{
71-
case AndroidXRPermission.SceneUnderstanding:
72-
return "android.permission.SCENE_UNDERSTANDING";
77+
case AndroidXRPermission.SceneUnderstandingCoarse:
78+
return "android.permission.SCENE_UNDERSTANDING_COARSE";
79+
case AndroidXRPermission.SceneUnderstandingFine:
80+
return "android.permission.SCENE_UNDERSTANDING_FINE";
7381
case AndroidXRPermission.HandTracking:
7482
return "android.permission.HAND_TRACKING";
75-
case AndroidXRPermission.EyeTracking:
76-
return "android.permission.EYE_TRACKING";
83+
case AndroidXRPermission.EyeTrackingCoarse:
84+
return "android.permission.EYE_TRACKING_COARSE";
7785
case AndroidXRPermission.EyeTrackingFine:
7886
return "android.permission.EYE_TRACKING_FINE";
7987
case AndroidXRPermission.FaceTracking:

Runtime/Features/XRAnchorFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public class XRAnchorFeature : OpenXRFeature
9494
/// Runtime permission required to enable scene understanding.
9595
/// </summary>
9696
public static readonly AndroidXRPermission RequiredPermission =
97-
AndroidXRPermission.SceneUnderstanding;
97+
AndroidXRPermission.SceneUnderstandingCoarse;
9898

9999
internal static bool? _extensionEnabled = null;
100100

Runtime/Features/XRObjectTrackingFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class XRObjectTrackingFeature : OpenXRFeature
8080
/// Runtime permission required to enable scene understanding.
8181
/// </summary>
8282
public static readonly AndroidXRPermission RequiredPermission =
83-
AndroidXRPermission.SceneUnderstanding;
83+
AndroidXRPermission.SceneUnderstandingCoarse;
8484

8585
internal static bool? _extensionEnabled = null;
8686

Runtime/Features/XRTrackableFeature.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class XRTrackableFeature : OpenXRFeature
7979
/// Runtime permission required to enable scene understanding.
8080
/// </summary>
8181
public static readonly AndroidXRPermission RequiredPermission =
82-
AndroidXRPermission.SceneUnderstanding;
82+
AndroidXRPermission.SceneUnderstandingCoarse;
8383

8484
internal static bool? _extensionEnabled = null;
8585

Runtime/Plugins/openxr_android.aar

11 Bytes
Binary file not shown.

Samples~/FaceTracking/FaceTracking.unity

+1-1
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ MonoBehaviour:
13071307
m_Script: {fileID: 11500000, guid: 020be0254b2eb4423832ec90c82d8a62, type: 3}
13081308
m_Name:
13091309
m_EditorClassIdentifier:
1310-
AndroidXRPermissions: 04000000
1310+
AndroidXRPermissions: 05000000
13111311
GenernalAndroidPermissions: []
13121312
PermissionRationale: Required for face tracking.
13131313
--- !u!1001 &1351983703979631387

Samples~/XRController/Prefab/LeftController.prefab

+24-24
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,20 @@ MonoBehaviour:
140140
m_Script: {fileID: 11500000, guid: 49ad92e74cacea040be7c224f4f331c3, type: 3}
141141
m_Name:
142142
m_EditorClassIdentifier:
143-
thumbStick: {fileID: 6560750023782525230}
144-
upperButton: {fileID: 3294422559947940247}
145-
lowerButton: {fileID: 3338177163201177434}
146-
systemButton: {fileID: 3535638649786920005}
147-
trigger: {fileID: 8090141865140552173}
148-
grip: {fileID: 762857701643272421}
149-
maxThumbStickRot: {x: 10, y: 10}
150-
pressedThumbStickOffset: 0.002
151-
pressedUpperBtnOffset: 0.002
152-
pressedLowerBtnOffset: 0.002
153-
pressedSystemBtnOffset: 0.001
154-
maxTriggerRot: 17
155-
maxGripRot: 10
156-
thumbStickInput:
143+
_thumbStick: {fileID: 6560750023782525230}
144+
_upperButton: {fileID: 3294422559947940247}
145+
_lowerButton: {fileID: 3338177163201177434}
146+
_systemButton: {fileID: 3535638649786920005}
147+
_trigger: {fileID: 8090141865140552173}
148+
_grip: {fileID: 762857701643272421}
149+
_maxThumbStickRot: {x: 10, y: 10}
150+
_pressedThumbStickOffset: 0.002
151+
_pressedUpperBtnOffset: 0.002
152+
_pressedLowerBtnOffset: 0.002
153+
_pressedSystemBtnOffset: 0.001
154+
_maxTriggerRot: 17
155+
_maxGripRot: 10
156+
_thumbStickInput:
157157
m_Name: Thumb Stick Input
158158
m_Type: 0
159159
m_ExpectedControlType: Vector2
@@ -170,7 +170,7 @@ MonoBehaviour:
170170
m_Action: Thumb Stick Input
171171
m_Flags: 0
172172
m_Flags: 0
173-
thumbStickPressedInput:
173+
_thumbStickPressedInput:
174174
m_Name: Thumb Stick Pressed Input
175175
m_Type: 1
176176
m_ExpectedControlType: Button
@@ -187,7 +187,7 @@ MonoBehaviour:
187187
m_Action: Thumb Stick Pressed Input
188188
m_Flags: 0
189189
m_Flags: 0
190-
upperButtonPressedInput:
190+
_upperButtonPressedInput:
191191
m_Name: Upper Button Pressed Input
192192
m_Type: 1
193193
m_ExpectedControlType: Button
@@ -204,7 +204,7 @@ MonoBehaviour:
204204
m_Action: Upper Button Pressed Input
205205
m_Flags: 0
206206
m_Flags: 0
207-
lowerButtonPressedInput:
207+
_lowerButtonPressedInput:
208208
m_Name: Lower Button Pressed Input
209209
m_Type: 1
210210
m_ExpectedControlType: Button
@@ -221,7 +221,7 @@ MonoBehaviour:
221221
m_Action: Lower Button Pressed Input
222222
m_Flags: 0
223223
m_Flags: 0
224-
systemButtonPressedInput:
224+
_systemButtonPressedInput:
225225
m_Name: System Button Pressed Input
226226
m_Type: 1
227227
m_ExpectedControlType: Button
@@ -238,7 +238,7 @@ MonoBehaviour:
238238
m_Action: System Button Pressed Input
239239
m_Flags: 0
240240
m_Flags: 0
241-
triggerInput:
241+
_triggerInput:
242242
m_Name: Trigger Input
243243
m_Type: 0
244244
m_ExpectedControlType:
@@ -255,7 +255,7 @@ MonoBehaviour:
255255
m_Action: Trigger Input
256256
m_Flags: 0
257257
m_Flags: 0
258-
gripInput:
258+
_gripInput:
259259
m_Name: Grip Input
260260
m_Type: 0
261261
m_ExpectedControlType:
@@ -272,10 +272,10 @@ MonoBehaviour:
272272
m_Action: Grip Input
273273
m_Flags: 0
274274
m_Flags: 0
275-
inverseThumbStickX: 1
276-
inverseThumbStickY: 1
277-
gripRotationPivot: {x: 0, y: 0, z: 1}
278-
triggerRotationPivot: {x: 1, y: 0, z: 0}
275+
_inverseThumbStickX: 1
276+
_inverseThumbStickY: 1
277+
_gripRotationPivot: {x: 0, y: 0, z: 1}
278+
_triggerRotationPivot: {x: 1, y: 0, z: 0}
279279
--- !u!114 &106320436904039793
280280
MonoBehaviour:
281281
m_ObjectHideFlags: 0

0 commit comments

Comments
 (0)