chore: cleanup
This commit is contained in:
1233
Cargo.lock
generated
1233
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -6,11 +6,11 @@ repository = "https://github.com/awtterpip/bevy_oxr"
|
||||
license = "MIT/Apache-2.0"
|
||||
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
resolver = "3"
|
||||
members = ["crates/*", "crates/bevy_openxr/examples/android"]
|
||||
|
||||
[workspace.dependencies]
|
||||
bevy = "0.18"
|
||||
bevy = { version = "0.18", features = ["debug"] }
|
||||
bevy_ecs = { version = "0.18", default-features = false }
|
||||
bevy_math = { version = "0.18", default-features = false }
|
||||
bevy_render = { version = "0.18", default-features = false }
|
||||
|
||||
@@ -2,3 +2,15 @@
|
||||
mod openxr;
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
pub use openxr::*;
|
||||
|
||||
pub mod prelude {
|
||||
pub use crate::{
|
||||
action_binding::OxrSendActionBindings, action_binding::OxrSuggestActionBinding,
|
||||
action_set_attaching::OxrAttachActionSet, action_set_syncing::OxrActionSetSyncSet,
|
||||
action_set_syncing::OxrSyncActionSet, add_xr_plugins, exts::OxrExtensions,
|
||||
features::handtracking::HandTrackingPlugin, init::OxrInitPlugin, openxr_session_running,
|
||||
resources::OxrInstance, resources::OxrSessionConfig, session::OxrSession,
|
||||
spaces::OxrSpaceExt,
|
||||
};
|
||||
pub use openxr::EnvironmentBlendMode;
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@ impl OxrExtensions {
|
||||
}
|
||||
/// returns true if all of the extensions enabled are also available in `available_exts`
|
||||
pub fn is_available(&self, available_exts: &OxrExtensions) -> bool {
|
||||
self.0.intersection(&available_exts) == self.0
|
||||
self.0.intersection(available_exts) == self.0
|
||||
}
|
||||
/// Returns any extensions needed by `required_exts` that aren't available in `self`
|
||||
pub fn unavailable_exts(&self, required_exts: &Self) -> Vec<String> {
|
||||
required_exts
|
||||
.difference(&self)
|
||||
.difference(self)
|
||||
.names()
|
||||
.into_iter()
|
||||
.filter_map(|v| {
|
||||
@@ -69,13 +69,7 @@ impl BitOr for OxrExtensions {
|
||||
|
||||
// this is horribly slow, but doesn't require a bunch of code duplication
|
||||
fn bitor(self, rhs: Self) -> Self::Output {
|
||||
Self(
|
||||
self.0
|
||||
.names()
|
||||
.into_iter()
|
||||
.chain(rhs.names().into_iter())
|
||||
.collect(),
|
||||
)
|
||||
Self(self.0.names().into_iter().chain(rhs.names()).collect())
|
||||
}
|
||||
}
|
||||
impl BitAnd for OxrExtensions {
|
||||
|
||||
@@ -14,6 +14,7 @@ use crate::{
|
||||
types::{AppInfo, OxrExtensions, Result, WgpuGraphics},
|
||||
};
|
||||
|
||||
#[allow(clippy::missing_safety_doc)]
|
||||
/// This is an extension trait to the [`Graphics`](openxr::Graphics) trait and is how the graphics API should be interacted with.
|
||||
pub unsafe trait GraphicsExt: openxr::Graphics {
|
||||
/// Wrap the graphics specific type into the [GraphicsWrap] enum
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::mem;
|
||||
|
||||
use bevy_ecs::world::World;
|
||||
use bevy_mod_xr::spaces::{XrPrimaryReferenceSpace, XrSpace};
|
||||
use openxr::{sys, CompositionLayerFlags, Fovf, Posef, Rect2Di};
|
||||
use openxr::{CompositionLayerFlags, Fovf, Posef, Rect2Di, sys};
|
||||
|
||||
use crate::graphics::graphics_match;
|
||||
use crate::resources::*;
|
||||
|
||||
@@ -21,7 +21,7 @@ pub struct OxrReferenceSpacePlugin {
|
||||
impl Default for OxrReferenceSpacePlugin {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
default_primary_ref_space: openxr::ReferenceSpaceType::STAGE,
|
||||
default_primary_ref_space: openxr::ReferenceSpaceType::LOCAL,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl OxrEntry {
|
||||
application_version: app_info.version.to_u32(),
|
||||
engine_name: "Bevy",
|
||||
engine_version: Version::BEVY.to_u32(),
|
||||
api_version: openxr::Version::new(1, 0, 34),
|
||||
api_version: openxr::Version::new(1, 1, 54),
|
||||
},
|
||||
&required_exts.into(),
|
||||
layers,
|
||||
|
||||
Reference in New Issue
Block a user