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"
|
license = "MIT/Apache-2.0"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "3"
|
||||||
members = ["crates/*", "crates/bevy_openxr/examples/android"]
|
members = ["crates/*", "crates/bevy_openxr/examples/android"]
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
bevy = "0.18"
|
bevy = { version = "0.18", features = ["debug"] }
|
||||||
bevy_ecs = { version = "0.18", default-features = false }
|
bevy_ecs = { version = "0.18", default-features = false }
|
||||||
bevy_math = { version = "0.18", default-features = false }
|
bevy_math = { version = "0.18", default-features = false }
|
||||||
bevy_render = { version = "0.18", default-features = false }
|
bevy_render = { version = "0.18", default-features = false }
|
||||||
|
|||||||
@@ -2,3 +2,15 @@
|
|||||||
mod openxr;
|
mod openxr;
|
||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
pub use openxr::*;
|
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`
|
/// returns true if all of the extensions enabled are also available in `available_exts`
|
||||||
pub fn is_available(&self, available_exts: &OxrExtensions) -> bool {
|
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`
|
/// Returns any extensions needed by `required_exts` that aren't available in `self`
|
||||||
pub fn unavailable_exts(&self, required_exts: &Self) -> Vec<String> {
|
pub fn unavailable_exts(&self, required_exts: &Self) -> Vec<String> {
|
||||||
required_exts
|
required_exts
|
||||||
.difference(&self)
|
.difference(self)
|
||||||
.names()
|
.names()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|v| {
|
.filter_map(|v| {
|
||||||
@@ -69,13 +69,7 @@ impl BitOr for OxrExtensions {
|
|||||||
|
|
||||||
// this is horribly slow, but doesn't require a bunch of code duplication
|
// this is horribly slow, but doesn't require a bunch of code duplication
|
||||||
fn bitor(self, rhs: Self) -> Self::Output {
|
fn bitor(self, rhs: Self) -> Self::Output {
|
||||||
Self(
|
Self(self.0.names().into_iter().chain(rhs.names()).collect())
|
||||||
self.0
|
|
||||||
.names()
|
|
||||||
.into_iter()
|
|
||||||
.chain(rhs.names().into_iter())
|
|
||||||
.collect(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl BitAnd for OxrExtensions {
|
impl BitAnd for OxrExtensions {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use crate::{
|
|||||||
types::{AppInfo, OxrExtensions, Result, WgpuGraphics},
|
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.
|
/// 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 {
|
pub unsafe trait GraphicsExt: openxr::Graphics {
|
||||||
/// Wrap the graphics specific type into the [GraphicsWrap] enum
|
/// Wrap the graphics specific type into the [GraphicsWrap] enum
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::mem;
|
|||||||
|
|
||||||
use bevy_ecs::world::World;
|
use bevy_ecs::world::World;
|
||||||
use bevy_mod_xr::spaces::{XrPrimaryReferenceSpace, XrSpace};
|
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::graphics::graphics_match;
|
||||||
use crate::resources::*;
|
use crate::resources::*;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub struct OxrReferenceSpacePlugin {
|
|||||||
impl Default for OxrReferenceSpacePlugin {
|
impl Default for OxrReferenceSpacePlugin {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
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(),
|
application_version: app_info.version.to_u32(),
|
||||||
engine_name: "Bevy",
|
engine_name: "Bevy",
|
||||||
engine_version: Version::BEVY.to_u32(),
|
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(),
|
&required_exts.into(),
|
||||||
layers,
|
layers,
|
||||||
|
|||||||
Reference in New Issue
Block a user