|
@@ -755,9 +755,9 @@ void EditorExportPlatformAndroid::_get_permissions(const Ref<EditorExportPreset>
|
|
}
|
|
}
|
|
|
|
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
- if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
|
|
|
|
+ if (xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) {
|
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
|
- if (hand_tracking_index > 0) {
|
|
|
|
|
|
+ if (hand_tracking_index > XR_HAND_TRACKING_NONE) {
|
|
if (r_permissions.find("com.oculus.permission.HAND_TRACKING") == -1) {
|
|
if (r_permissions.find("com.oculus.permission.HAND_TRACKING") == -1) {
|
|
r_permissions.push_back("com.oculus.permission.HAND_TRACKING");
|
|
r_permissions.push_back("com.oculus.permission.HAND_TRACKING");
|
|
}
|
|
}
|
|
@@ -976,14 +976,14 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|
|
|
|
|
if (tname == "meta-data" && attrname == "name" && value == "xr_mode_metadata_name") {
|
|
if (tname == "meta-data" && attrname == "name" && value == "xr_mode_metadata_name") {
|
|
// Update the meta-data 'android:name' attribute based on the selected XR mode.
|
|
// Update the meta-data 'android:name' attribute based on the selected XR mode.
|
|
- if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
|
|
|
|
+ if (xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) {
|
|
string_table.write[attr_value] = "com.samsung.android.vr.application.mode";
|
|
string_table.write[attr_value] = "com.samsung.android.vr.application.mode";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (tname == "meta-data" && attrname == "value" && value == "xr_mode_metadata_value") {
|
|
if (tname == "meta-data" && attrname == "value" && value == "xr_mode_metadata_value") {
|
|
// Update the meta-data 'android:value' attribute based on the selected XR mode.
|
|
// Update the meta-data 'android:value' attribute based on the selected XR mode.
|
|
- if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
|
|
|
|
+ if (xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) {
|
|
string_table.write[attr_value] = "vr_only";
|
|
string_table.write[attr_value] = "vr_only";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1002,7 +1002,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|
Vector<bool> feature_required_list;
|
|
Vector<bool> feature_required_list;
|
|
Vector<int> feature_versions;
|
|
Vector<int> feature_versions;
|
|
|
|
|
|
- if (xr_mode_index == 1 /* XRMode.OVR */) {
|
|
|
|
|
|
+ if (xr_mode_index == XR_MODE_OVR || xr_mode_index == XR_MODE_OPENXR) {
|
|
// Set degrees of freedom
|
|
// Set degrees of freedom
|
|
feature_names.push_back("android.hardware.vr.headtracking");
|
|
feature_names.push_back("android.hardware.vr.headtracking");
|
|
feature_required_list.push_back(true);
|
|
feature_required_list.push_back(true);
|
|
@@ -1010,11 +1010,21 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p
|
|
|
|
|
|
// Check for hand tracking
|
|
// Check for hand tracking
|
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
|
int hand_tracking_index = p_preset->get("xr_features/hand_tracking"); // 0: none, 1: optional, 2: required
|
|
- if (hand_tracking_index > 0) {
|
|
|
|
|
|
+ if (hand_tracking_index > XR_HAND_TRACKING_NONE) {
|
|
feature_names.push_back("oculus.software.handtracking");
|
|
feature_names.push_back("oculus.software.handtracking");
|
|
- feature_required_list.push_back(hand_tracking_index == 2);
|
|
|
|
|
|
+ feature_required_list.push_back(hand_tracking_index == XR_HAND_TRACKING_REQUIRED);
|
|
feature_versions.push_back(-1); // no version attribute should be added.
|
|
feature_versions.push_back(-1); // no version attribute should be added.
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (xr_mode_index == XR_MODE_OPENXR) {
|
|
|
|
+ // Check for passthrough
|
|
|
|
+ int passthrough_mode = p_preset->get("xr_features/passthrough");
|
|
|
|
+ if (passthrough_mode > XR_PASSTHROUGH_NONE) {
|
|
|
|
+ feature_names.push_back("com.oculus.feature.PASSTHROUGH");
|
|
|
|
+ feature_required_list.push_back(passthrough_mode == XR_PASSTHROUGH_REQUIRED);
|
|
|
|
+ feature_versions.push_back(-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (feature_names.size() > 0) {
|
|
if (feature_names.size() > 0) {
|
|
@@ -1694,8 +1704,9 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/32_bits_framebuffer"), true));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/opengl_debug"), false));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "graphics/opengl_debug"), false));
|
|
|
|
|
|
- r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VR"), 0));
|
|
|
|
|
|
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/xr_mode", PROPERTY_HINT_ENUM, "Regular,Oculus Mobile VrApi (Deprecated),OpenXR"), 0));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/hand_tracking", PROPERTY_HINT_ENUM, "None,Optional,Required"), 0));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/hand_tracking", PROPERTY_HINT_ENUM, "None,Optional,Required"), 0));
|
|
|
|
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "xr_features/passthrough", PROPERTY_HINT_ENUM, "None,Optional,Required"), 0));
|
|
|
|
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/immersive_mode"), true));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
|
|
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_small"), true));
|
|
@@ -2184,10 +2195,19 @@ bool EditorExportPlatformAndroid::can_export(const Ref<EditorExportPreset> &p_pr
|
|
// Validate the Xr features are properly populated
|
|
// Validate the Xr features are properly populated
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
int hand_tracking = p_preset->get("xr_features/hand_tracking");
|
|
int hand_tracking = p_preset->get("xr_features/hand_tracking");
|
|
- if (xr_mode_index != /* XRMode.OVR*/ 1) {
|
|
|
|
- if (hand_tracking > 0) {
|
|
|
|
|
|
+ int passthrough_mode = p_preset->get("xr_features/passthrough");
|
|
|
|
+ if (xr_mode_index != XR_MODE_OVR && xr_mode_index != XR_MODE_OPENXR) {
|
|
|
|
+ if (hand_tracking > XR_HAND_TRACKING_NONE) {
|
|
|
|
+ valid = false;
|
|
|
|
+ err += TTR("\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" or \"OpenXR\".");
|
|
|
|
+ err += "\n";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (xr_mode_index != XR_MODE_OPENXR) {
|
|
|
|
+ if (passthrough_mode > XR_PASSTHROUGH_NONE) {
|
|
valid = false;
|
|
valid = false;
|
|
- err += TTR("\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VR\".");
|
|
|
|
|
|
+ err += TTR("\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\".");
|
|
err += "\n";
|
|
err += "\n";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -2524,8 +2544,10 @@ void EditorExportPlatformAndroid::get_command_line_flags(const Ref<EditorExportP
|
|
}
|
|
}
|
|
|
|
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
int xr_mode_index = p_preset->get("xr_features/xr_mode");
|
|
- if (xr_mode_index == 1) {
|
|
|
|
|
|
+ if (xr_mode_index == XR_MODE_OVR) {
|
|
command_line_strings.push_back("--xr_mode_ovr");
|
|
command_line_strings.push_back("--xr_mode_ovr");
|
|
|
|
+ } else if (xr_mode_index == XR_MODE_OPENXR) {
|
|
|
|
+ command_line_strings.push_back("--xr_mode_openxr");
|
|
} else { // XRMode.REGULAR is the default.
|
|
} else { // XRMode.REGULAR is the default.
|
|
command_line_strings.push_back("--xr_mode_regular");
|
|
command_line_strings.push_back("--xr_mode_regular");
|
|
}
|
|
}
|