Starter Bevy OpenXR App
bevy_xr_app
is a ready-to-go starter template for using OpenXR with Bevy. It includes basic scene editor support (thanks to bevy_editor_pls
). It also includes an OpenXR simulator with WASD + Mouse input so you can develop XR applications without putting on a headset.
bevy_xr_app
is tested on both MacOS and Windows, including the built-in OpenXR simulator. Linux should work but has undergone less testing.
sim.demo.mp4
Device | PCVR | Quest | Simulator | |
---|---|---|---|---|
OS | ||||
MacOS | ✖️ | ✅ | ✅ | |
Windows | ✅ | ✅ | ✅ | |
Linux | ❔ | ❔ | ✅ |
Simulator
- Make sure the
simulator
feature is enabled. Optionally enable theeditor
feature if desired. cargo run
Quest
- Install Android Stuido. Then install the Android SDK Platform, NDK (Side-by-Side), SDK Build-Tools, and SDK Platform-Tools using the Android Studio SDK Manager. Choose the Android SDK Platform version based on the
target_sdk_version
inCargo.toml
(currently 29). Feel free to install the latest version of everything else. See the following screenshots:
- Set the following Environment Variables (macOS example)
export ANDROID_HOME=$HOME/Library/Android/sdk
export ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/25.1.8937393 # you may have installed a different version, check what is present
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_NDK_ROOT:$PATH"
-
Install Java for the included
keytool
binary for signing APKs.brew install openjdk
on macOS
-
Download the Oculus OpenXR Mobile SDK and copy
OpenXR/Libs/Android/arm64-v8a/Release/libopenxr_loader.so
tolibs/arm64-v8a
in this project directory.
cp ~/Downloads/ovr_openxr_mobile_sdk_*/OpenXR/Libs/Android/arm64-v8a/Release/libopenxr_loader.so libs/arm64-v8a
- Install
cargo-apk
CLI (cargo install -f cargo-apk
)
Run ./android-run.sh
or ./android-run.ps1
depending on your platform.
PCVR
- Make sure the
simulator
feature is disabled. Theeditor
feature may be enabled or disabled. cargo run