You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Clean up the XR features parameters from core
Following on the previous commit, the XR features logic have now be moved to the Godot OpenXR loader plugin. See https://github.com/GodotVR/godot_openxr_loaders/pull/38
This commit is contained in:
committed by
Yuri Sizov
parent
d17811c814
commit
b52e1be2c2
@@ -254,28 +254,6 @@ String _get_screen_sizes_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||
return manifest_screen_sizes;
|
||||
}
|
||||
|
||||
String _get_xr_features_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||
String manifest_xr_features;
|
||||
int xr_mode_index = (int)(p_preset->get("xr_features/xr_mode"));
|
||||
bool uses_xr = xr_mode_index == XR_MODE_OPENXR;
|
||||
if (uses_xr) {
|
||||
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
||||
if (hand_tracking_index == XR_HAND_TRACKING_OPTIONAL) {
|
||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"oculus.software.handtracking\" android:required=\"false\" />\n";
|
||||
} else if (hand_tracking_index == XR_HAND_TRACKING_REQUIRED) {
|
||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"oculus.software.handtracking\" android:required=\"true\" />\n";
|
||||
}
|
||||
|
||||
int passthrough_mode = p_preset->get("xr_features/passthrough");
|
||||
if (passthrough_mode == XR_PASSTHROUGH_OPTIONAL) {
|
||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"com.oculus.feature.PASSTHROUGH\" android:required=\"false\" />\n";
|
||||
} else if (passthrough_mode == XR_PASSTHROUGH_REQUIRED) {
|
||||
manifest_xr_features += " <uses-feature tools:node=\"replace\" android:name=\"com.oculus.feature.PASSTHROUGH\" android:required=\"true\" />\n";
|
||||
}
|
||||
}
|
||||
return manifest_xr_features;
|
||||
}
|
||||
|
||||
String _get_activity_tag(const Ref<EditorExportPlatform> &p_export_platform, const Ref<EditorExportPreset> &p_preset, bool p_debug) {
|
||||
String orientation = _get_android_orientation_label(DisplayServer::ScreenOrientation(int(GLOBAL_GET("display/window/handheld/orientation"))));
|
||||
String manifest_activity_text = vformat(
|
||||
@@ -293,22 +271,6 @@ String _get_activity_tag(const Ref<EditorExportPlatform> &p_export_platform, con
|
||||
" <action android:name=\"android.intent.action.MAIN\" />\n"
|
||||
" <category android:name=\"android.intent.category.LAUNCHER\" />\n";
|
||||
|
||||
int xr_mode_index = (int)(p_preset->get("xr_features/xr_mode"));
|
||||
bool uses_xr = xr_mode_index == XR_MODE_OPENXR;
|
||||
if (uses_xr) {
|
||||
manifest_activity_text += "\n"
|
||||
" <!-- Enable access to OpenXR on Oculus mobile devices, no-op on other Android\n"
|
||||
" platforms. -->\n"
|
||||
" <category android:name=\"com.oculus.intent.category.VR\" />\n"
|
||||
"\n"
|
||||
" <!-- OpenXR category tag to indicate the activity starts in an immersive OpenXR mode. \n"
|
||||
" See https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#android-runtime-category. -->\n"
|
||||
" <category android:name=\"org.khronos.openxr.intent.category.IMMERSIVE_HMD\" />\n"
|
||||
"\n"
|
||||
" <!-- Enable VR access on HTC Vive Focus devices. -->\n"
|
||||
" <category android:name=\"com.htc.intent.category.VRAPP\" />\n";
|
||||
}
|
||||
|
||||
bool uses_leanback_category = p_preset->get("package/show_in_android_tv");
|
||||
if (uses_leanback_category) {
|
||||
manifest_activity_text += " <category android:name=\"android.intent.category.LEANBACK_LAUNCHER\" />\n";
|
||||
@@ -341,9 +303,6 @@ String _get_application_tag(const Ref<EditorExportPlatform> &p_export_platform,
|
||||
int app_category_index = (int)(p_preset->get("package/app_category"));
|
||||
bool is_game = app_category_index == APP_CATEGORY_GAME;
|
||||
|
||||
int xr_mode_index = (int)(p_preset->get("xr_features/xr_mode"));
|
||||
bool uses_xr = xr_mode_index == XR_MODE_OPENXR;
|
||||
|
||||
String manifest_application_text = vformat(
|
||||
" <application android:label=\"@string/godot_project_name_string\"\n"
|
||||
" android:allowBackup=\"%s\"\n"
|
||||
@@ -360,18 +319,6 @@ String _get_application_tag(const Ref<EditorExportPlatform> &p_export_platform,
|
||||
bool_to_string(p_preset->get("package/retain_data_on_uninstall")),
|
||||
bool_to_string(p_has_read_write_storage_permission));
|
||||
|
||||
if (uses_xr) {
|
||||
bool hand_tracking_enabled = (int)(p_preset->get("xr_features/hand_tracking")) > XR_HAND_TRACKING_NONE;
|
||||
if (hand_tracking_enabled) {
|
||||
int hand_tracking_frequency_index = p_preset->get("xr_features/hand_tracking_frequency");
|
||||
String hand_tracking_frequency = hand_tracking_frequency_index == XR_HAND_TRACKING_FREQUENCY_LOW ? "LOW" : "HIGH";
|
||||
manifest_application_text += vformat(
|
||||
" <meta-data tools:node=\"replace\" android:name=\"com.oculus.handtracking.frequency\" android:value=\"%s\" />\n",
|
||||
hand_tracking_frequency);
|
||||
manifest_application_text += " <meta-data tools:node=\"replace\" android:name=\"com.oculus.handtracking.version\" android:value=\"V2.0\" />\n";
|
||||
}
|
||||
}
|
||||
|
||||
Vector<Ref<EditorExportPlugin>> export_plugins = EditorExport::get_singleton()->get_export_plugins();
|
||||
for (int i = 0; i < export_plugins.size(); i++) {
|
||||
if (export_plugins[i]->supports_platform(p_export_platform)) {
|
||||
|
||||
Reference in New Issue
Block a user