From 9f4aa1f5adac2b152e91abe2a175319f3d4403bf Mon Sep 17 00:00:00 2001 From: ne0fhyk Date: Fri, 27 Aug 2021 10:36:29 -0700 Subject: Update the AndroidManifest to enable access to Oculus OpenXR runtime. --- platform/android/export/export_plugin.cpp | 5 +++++ platform/android/export/gradle_export_util.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'platform/android/export') diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index bdf12b6c50..b220b64df1 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -977,6 +977,11 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref &p Vector feature_versions; if (xr_mode_index == 1 /* XRMode.OVR */) { + // Set degrees of freedom + feature_names.push_back("android.hardware.vr.headtracking"); + feature_required_list.push_back(true); + feature_versions.push_back(1); + // Check for hand tracking int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required if (hand_tracking_index > 0) { diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index b9e28a7937..6fbdf73cd0 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -197,6 +197,8 @@ String _get_xr_features_tag(const Ref &p_preset) { String manifest_xr_features; bool uses_xr = (int)(p_preset->get("xr_features/xr_mode")) == 1; if (uses_xr) { + manifest_xr_features += " \n"; + int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required if (hand_tracking_index == 1) { manifest_xr_features += " \n"; @@ -228,7 +230,9 @@ String _get_activity_tag(const Ref &p_preset) { "tools:replace=\"android:screenOrientation\" " "android:screenOrientation=\"%s\">\n", orientation); - if (!uses_xr) { + if (uses_xr) { + manifest_activity_text += " \n"; + } else { manifest_activity_text += " \n"; } manifest_activity_text += " \n"; -- cgit v1.2.3