diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b254df5..d522457 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: "Cache" uses: Swatinem/rust-cache@v2 - name: "External dependencies" - run: sudo apt-get install -y libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libudev-dev + run: sudo apt-get install -y libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev libudev-dev libopenxr-loader1 libopenxr-dev - name: "Checks" run: | cargo update diff --git a/Cargo.toml b/Cargo.toml index 8bac2b7..a29504a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,22 +1,32 @@ [package] -name = "bevy_openxr" +name = "bevy_oxr" version = "0.1.0" edition = "2021" +description = "Community crate for OpenXR in Bevy" +license = "MIT/Apache-2.0" [features] -default = ["linked"] -linked = ["openxr/linked", "openxr/static"] +default = ["openxr/mint", "linked"] +linked = ["openxr/linked"] + +[workspace] +members = [ "examples/android" ] [dependencies] anyhow = "1.0.75" ash = "0.37.3" bevy = "0.12" -openxr = { version = "0.17.1", features = ["mint"] } mint = "0.5.9" wgpu = "0.17.1" wgpu-core = { version = "0.17.1", features = ["vulkan"] } wgpu-hal = "0.17.1" +[target.'cfg( target_family = "unix" )'.dependencies] +openxr = "0.17.1" + +[target.'cfg(not(target_family = "unix"))'.dependencies] +openxr = { version = "0.17.1", features = ["static"] } + [dev-dependencies] bevy = "0.12" color-eyre = "0.6.2" diff --git a/README.md b/README.md index a0c7eb2..8fe5d79 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,9 @@ An in-progress crate for adding openxr support to Bevy without forking. ![image](https://github.com/awtterpip/bevy_openxr/assets/50841145/aa01fde4-7915-49b9-b486-ff61ce6d57a9) To see it in action run the example in `examples` with `cargo run --example xr` + +## Troubleshooting + +- Make sure, if you're on Linux, that you have the `openxr` package installed on your system. +- I'm getting poor performance. + - Like other bevy projects, make sure you're building in release (example: `cargo run --example xr --release`) diff --git a/examples/android/Cargo.toml b/examples/android/Cargo.toml index 3272734..d084c7e 100644 --- a/examples/android/Cargo.toml +++ b/examples/android/Cargo.toml @@ -29,7 +29,7 @@ target_sdk_version = 32 # label = "Bevy Example" [dependencies] -bevy_openxr = { path = "../..", default-features = false } +bevy_oxr = { path = "../..", default-features = false } bevy = "0.12" openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] } diff --git a/examples/android/src/lib.rs b/examples/android/src/lib.rs index d5501df..4f8bdeb 100644 --- a/examples/android/src/lib.rs +++ b/examples/android/src/lib.rs @@ -1,12 +1,12 @@ use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; use bevy::prelude::*; use bevy::transform::components::Transform; -use bevy_openxr::xr_input::debug_gizmos::OpenXrDebugRenderer; -use bevy_openxr::xr_input::prototype_locomotion::{proto_locomotion, PrototypeLocomotionConfig}; -use bevy_openxr::xr_input::trackers::{ +use bevy_oxr::xr_input::debug_gizmos::OpenXrDebugRenderer; +use bevy_oxr::xr_input::prototype_locomotion::{proto_locomotion, PrototypeLocomotionConfig}; +use bevy_oxr::xr_input::trackers::{ OpenXRController, OpenXRLeftController, OpenXRRightController, OpenXRTracker, }; -use bevy_openxr::DefaultXrPlugins; +use bevy_oxr::DefaultXrPlugins; #[bevy_main] fn main() { diff --git a/examples/xr.rs b/examples/xr.rs index 8644265..b8dc849 100644 --- a/examples/xr.rs +++ b/examples/xr.rs @@ -4,22 +4,22 @@ use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; use bevy::prelude::*; use bevy::transform::components::Transform; -use bevy_openxr::input::XrInput; -use bevy_openxr::resources::{XrFrameState, XrInstance, XrSession}; +use bevy_oxr::input::XrInput; +use bevy_oxr::resources::{XrFrameState, XrInstance, XrSession}; -use bevy_openxr::xr_input::hand::{OpenXrHandInput, HandInputDebugRenderer}; -use bevy_openxr::xr_input::interactions::{ +use bevy_oxr::xr_input::hand::{OpenXrHandInput, HandInputDebugRenderer}; +use bevy_oxr::xr_input::interactions::{ draw_interaction_gizmos, draw_socket_gizmos, interactions, socket_interactions, update_interactable_states, InteractionEvent, Touched, XRDirectInteractor, XRInteractable, XRInteractableState, XRInteractorState, XRRayInteractor, XRSocketInteractor, }; -use bevy_openxr::xr_input::oculus_touch::OculusController; -use bevy_openxr::xr_input::prototype_locomotion::{proto_locomotion, PrototypeLocomotionConfig}; -use bevy_openxr::xr_input::trackers::{ +use bevy_oxr::xr_input::oculus_touch::OculusController; +use bevy_oxr::xr_input::prototype_locomotion::{proto_locomotion, PrototypeLocomotionConfig}; +use bevy_oxr::xr_input::trackers::{ AimPose, OpenXRController, OpenXRLeftController, OpenXRRightController, OpenXRTracker, }; -use bevy_openxr::xr_input::Hand; -use bevy_openxr::DefaultXrPlugins; +use bevy_oxr::xr_input::Hand; +use bevy_oxr::DefaultXrPlugins; fn main() { color_eyre::install().unwrap();