Skip to content

Commit

Permalink
Use Khronos loader for Pico and add store required manifest entries (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
BastiaanOlij authored Jun 29, 2024
1 parent c0650fe commit aec5063
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-addon-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
cp aar/thirdparty/ovr_openxr_mobile_sdk/LICENSE.txt asset/addons/godotopenxrvendors/meta/
mkdir -p asset/addons/godotopenxrvendors/pico/
cp aar/thirdparty/pico_openxr_sdk/README.md asset/addons/godotopenxrvendors/pico/LICENSE.md
cp aar/thirdparty/khronos_openxr_sdk/LICENSE asset/addons/godotopenxrvendors/pico/LICENSE
mkdir -p asset/addons/godotopenxrvendors/khronos/
cp aar/thirdparty/khronos_openxr_sdk/LICENSE asset/addons/godotopenxrvendors/khronos/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- Add OpenXRMetaPassthroughColorLut
- Add feature flags to Khronos loader for HTC
- Add XR_HTC_passthrough extension wrapper
- Add manifest entries to Pico loader
- Add manifest entries to Pico and switch Pico to using the Khronos Loader

## 2.0.3
- Migrate the export scripts from gdscript to C++ via gdextension
Expand Down
4 changes: 0 additions & 4 deletions common/src/main/cpp/export/pico_export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ String PicoEditorExportPlugin::_get_android_manifest_application_element_content
return contents;
}

// Standard entries
contents += " <meta-data tools:node=\"replace\" android:name=\"pvr.app.type\" android:value=\"vr\" />\n";
contents += " <meta-data tools:node=\"replace\" android:name=\"pvr.display.orientation\" android:value=\"180\" />\n";

// Check for eye tracking
if (_is_eye_tracking_enabled()) {
contents += " <meta-data tools:node=\"replace\" android:name=\"picovr.software.eye_tracking\" android:value=\"1\" />\n";
Expand Down
11 changes: 3 additions & 8 deletions godotopenxrpico/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ project(godotopenxrvendors LANGUAGES CXX)
## Common dependencies
include(${PROJECT_SOURCE_DIR}/../common/common.cmake)

## Pico OpenXR loader library
set(PICO_OPENXR_LIB_PATH "${PROJECT_SOURCE_DIR}/../thirdparty/pico_openxr_sdk/${ANDROID_ABI}/libopenxr_loader.so")
add_library(openxr_loader
SHARED
IMPORTED GLOBAL
)
set_target_properties(openxr_loader PROPERTIES IMPORTED_LOCATION ${PICO_OPENXR_LIB_PATH})
## khronos OpenXR loader library
find_package(OpenXR REQUIRED CONFIG)

## Setup the project sources
file(GLOB_RECURSE ANDROID_SOURCES ${PROJECT_SOURCE_DIR}/src/main/cpp/*.c**)
Expand All @@ -37,7 +32,7 @@ target_link_libraries(${PROJECT_NAME}
android
log
${GODOT-CPP}
openxr_loader
OpenXR::openxr_loader
)

# Add the compile flags
Expand Down
2 changes: 2 additions & 0 deletions godotopenxrpico/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ android {
}

buildFeatures {
prefab true
prefabPublishing true
}

Expand All @@ -65,6 +66,7 @@ android {

dependencies {
compileOnly libraries.godotAndroidLib
implementation "org.khronos.openxr:openxr_loader_for_android:1.0.34"
}

task cleanAssets(type: Delete) {
Expand Down
18 changes: 18 additions & 0 deletions godotopenxrpico/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Tell the system this app works in either 3dof or 6dof mode -->
<uses-feature
android:name="android.hardware.vr.headtracking"
android:required="true"
android:version="1"/>

<!-- Permissions needed by OpenXR -->
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />

<queries>
<intent>
<action android:name="org.khronos.openxr.OpenXRRuntimeService"/>
</intent>
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
</queries>

<application>
<!-- Godot plugin registration -->
Expand All @@ -8,6 +24,8 @@

<!-- Enable VR mode on Pico headsets -->
<meta-data android:name="pvr.app.type" android:value="vr" />
<meta-data android:name="pvr.sdk.version" android:value="OpenXR" />";
<meta-data android:name="pvr.display.orientation" android:value="180" />";
</application>

</manifest>
63 changes: 0 additions & 63 deletions thirdparty/pico_openxr_sdk/README.md

This file was deleted.

Binary file not shown.

0 comments on commit aec5063

Please sign in to comment.