Skip to content

Commit aec5063

Browse files
authored
Use Khronos loader for Pico and add store required manifest entries (#180)
1 parent c0650fe commit aec5063

File tree

8 files changed

+25
-77
lines changed

8 files changed

+25
-77
lines changed

Diff for: .github/workflows/build-addon-on-push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
cp aar/thirdparty/ovr_openxr_mobile_sdk/LICENSE.txt asset/addons/godotopenxrvendors/meta/
140140
141141
mkdir -p asset/addons/godotopenxrvendors/pico/
142-
cp aar/thirdparty/pico_openxr_sdk/README.md asset/addons/godotopenxrvendors/pico/LICENSE.md
142+
cp aar/thirdparty/khronos_openxr_sdk/LICENSE asset/addons/godotopenxrvendors/pico/LICENSE
143143
144144
mkdir -p asset/addons/godotopenxrvendors/khronos/
145145
cp aar/thirdparty/khronos_openxr_sdk/LICENSE asset/addons/godotopenxrvendors/khronos/LICENSE

Diff for: CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- Add OpenXRMetaPassthroughColorLut
1818
- Add feature flags to Khronos loader for HTC
1919
- Add XR_HTC_passthrough extension wrapper
20-
- Add manifest entries to Pico loader
20+
- Add manifest entries to Pico and switch Pico to using the Khronos Loader
2121

2222
## 2.0.3
2323
- Migrate the export scripts from gdscript to C++ via gdextension

Diff for: common/src/main/cpp/export/pico_export_plugin.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ String PicoEditorExportPlugin::_get_android_manifest_application_element_content
164164
return contents;
165165
}
166166

167-
// Standard entries
168-
contents += " <meta-data tools:node=\"replace\" android:name=\"pvr.app.type\" android:value=\"vr\" />\n";
169-
contents += " <meta-data tools:node=\"replace\" android:name=\"pvr.display.orientation\" android:value=\"180\" />\n";
170-
171167
// Check for eye tracking
172168
if (_is_eye_tracking_enabled()) {
173169
contents += " <meta-data tools:node=\"replace\" android:name=\"picovr.software.eye_tracking\" android:value=\"1\" />\n";

Diff for: godotopenxrpico/CMakeLists.txt

+3-8
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ project(godotopenxrvendors LANGUAGES CXX)
66
## Common dependencies
77
include(${PROJECT_SOURCE_DIR}/../common/common.cmake)
88

9-
## Pico OpenXR loader library
10-
set(PICO_OPENXR_LIB_PATH "${PROJECT_SOURCE_DIR}/../thirdparty/pico_openxr_sdk/${ANDROID_ABI}/libopenxr_loader.so")
11-
add_library(openxr_loader
12-
SHARED
13-
IMPORTED GLOBAL
14-
)
15-
set_target_properties(openxr_loader PROPERTIES IMPORTED_LOCATION ${PICO_OPENXR_LIB_PATH})
9+
## khronos OpenXR loader library
10+
find_package(OpenXR REQUIRED CONFIG)
1611

1712
## Setup the project sources
1813
file(GLOB_RECURSE ANDROID_SOURCES ${PROJECT_SOURCE_DIR}/src/main/cpp/*.c**)
@@ -37,7 +32,7 @@ target_link_libraries(${PROJECT_NAME}
3732
android
3833
log
3934
${GODOT-CPP}
40-
openxr_loader
35+
OpenXR::openxr_loader
4136
)
4237

4338
# Add the compile flags

Diff for: godotopenxrpico/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ android {
5353
}
5454

5555
buildFeatures {
56+
prefab true
5657
prefabPublishing true
5758
}
5859

@@ -65,6 +66,7 @@ android {
6566

6667
dependencies {
6768
compileOnly libraries.godotAndroidLib
69+
implementation "org.khronos.openxr:openxr_loader_for_android:1.0.34"
6870
}
6971

7072
task cleanAssets(type: Delete) {

Diff for: godotopenxrpico/src/main/AndroidManifest.xml

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<!-- Tell the system this app works in either 3dof or 6dof mode -->
4+
<uses-feature
5+
android:name="android.hardware.vr.headtracking"
6+
android:required="true"
7+
android:version="1"/>
8+
9+
<!-- Permissions needed by OpenXR -->
10+
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
11+
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />
12+
13+
<queries>
14+
<intent>
15+
<action android:name="org.khronos.openxr.OpenXRRuntimeService"/>
16+
</intent>
17+
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
18+
</queries>
319

420
<application>
521
<!-- Godot plugin registration -->
@@ -8,6 +24,8 @@
824

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

1331
</manifest>

Diff for: thirdparty/pico_openxr_sdk/README.md

-63
This file was deleted.
-1.51 MB
Binary file not shown.

0 commit comments

Comments
 (0)