use openxr git version (#62)

* fix problems with get version

* a litle Recentering as a treat?

* commit new Cargo.toml

* re export path null so you don't have to import openxr yourself
This commit is contained in:
Schmarni
2024-01-01 02:30:12 +01:00
committed by GitHub
parent 65a30cac3c
commit b2efa802cb
5 changed files with 37 additions and 10 deletions

View File

@@ -25,11 +25,20 @@ wgpu-core = { version = "0.17.1", features = ["vulkan"] }
wgpu-hal = "0.17.1" wgpu-hal = "0.17.1"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
openxr = { version = "0.17.1", features = ["linked","static","mint"] } openxr = { git = "https://github.com/Ralith/openxrs", rev = "0177d2d", features = [
"linked",
"static",
"mint",
] }
[target.'cfg(all(target_family = "unix", not(target_arch = "wasm32")) )'.dependencies] [target.'cfg(all(target_family = "unix", not(target_arch = "wasm32")) )'.dependencies]
openxr = { version = "0.17.1", features = ["mint"] } openxr = { git = "https://github.com/Ralith/openxrs", rev = "0177d2d", features = [
"mint",
] }
[target.'cfg(all(not(target_family = "unix"), not(target_arch = "wasm32")))'.dependencies] [target.'cfg(all(not(target_family = "unix"), not(target_arch = "wasm32")))'.dependencies]
openxr = { version = "0.17.1", features = ["mint", "static"] } openxr = { git = "https://github.com/Ralith/openxrs", rev = "0177d2d", features = [
"mint",
"static",
] }
[dev-dependencies] [dev-dependencies]
bevy = "0.12" bevy = "0.12"

View File

@@ -14,7 +14,7 @@ crate-type = ["rlib", "cdylib"]
[dependencies] [dependencies]
bevy_oxr.path = "../.." bevy_oxr.path = "../.."
bevy = "0.12" bevy = "0.12"
openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] } openxr = { git = "https://github.com/Ralith/openxrs", rev = "0177d2d", features = ["mint"] }
[profile.release] [profile.release]
lto = "fat" lto = "fat"

View File

@@ -26,6 +26,14 @@ impl XrExtensions {
self.0.ext_hand_tracking = false; self.0.ext_hand_tracking = false;
self self
} }
pub fn enable_local_floor(&mut self) -> &mut Self {
self.0.ext_local_floor = true;
self
}
pub fn disable_local_floor(&mut self) -> &mut Self {
self.0.ext_local_floor = false;
self
}
} }
impl From<ExtensionSet> for XrExtensions { impl From<ExtensionSet> for XrExtensions {
fn from(value: ExtensionSet) -> Self { fn from(value: ExtensionSet) -> Self {
@@ -41,6 +49,7 @@ impl Default for XrExtensions {
fn default() -> Self { fn default() -> Self {
let mut exts = ExtensionSet::default(); let mut exts = ExtensionSet::default();
exts.ext_hand_tracking = true; exts.ext_hand_tracking = true;
exts.ext_local_floor = true;
Self(exts) Self(exts)
} }
} }
@@ -49,6 +58,7 @@ impl ops::BitAnd for XrExtensions {
fn bitand(self, rhs: Self) -> Self::Output { fn bitand(self, rhs: Self) -> Self::Output {
let mut out = ExtensionSet::default(); let mut out = ExtensionSet::default();
out.ext_local_floor = self.0.ext_local_floor && rhs.0.ext_local_floor;
out.almalence_digital_lens_control = out.almalence_digital_lens_control =
self.0.almalence_digital_lens_control && rhs.0.almalence_digital_lens_control; self.0.almalence_digital_lens_control && rhs.0.almalence_digital_lens_control;
out.epic_view_configuration_fov = out.epic_view_configuration_fov =
@@ -73,7 +83,7 @@ impl ops::BitAnd for XrExtensions {
self.0.ext_hp_mixed_reality_controller && rhs.0.ext_hp_mixed_reality_controller; self.0.ext_hp_mixed_reality_controller && rhs.0.ext_hp_mixed_reality_controller;
out.ext_palm_pose = self.0.ext_palm_pose && rhs.0.ext_palm_pose; out.ext_palm_pose = self.0.ext_palm_pose && rhs.0.ext_palm_pose;
out.ext_uuid = self.0.ext_uuid && rhs.0.ext_uuid; out.ext_uuid = self.0.ext_uuid && rhs.0.ext_uuid;
out.extx_overlay = self.0.extx_overlay && rhs.0.extx_overlay; // out.extx_overlay = self.0.extx_overlay && rhs.0.extx_overlay;
out.fb_composition_layer_image_layout = out.fb_composition_layer_image_layout =
self.0.fb_composition_layer_image_layout && rhs.0.fb_composition_layer_image_layout; self.0.fb_composition_layer_image_layout && rhs.0.fb_composition_layer_image_layout;
out.fb_composition_layer_alpha_blend = out.fb_composition_layer_alpha_blend =
@@ -122,8 +132,8 @@ impl ops::BitAnd for XrExtensions {
out.htc_hand_interaction = self.0.htc_hand_interaction && rhs.0.htc_hand_interaction; out.htc_hand_interaction = self.0.htc_hand_interaction && rhs.0.htc_hand_interaction;
out.htc_vive_wrist_tracker_interaction = out.htc_vive_wrist_tracker_interaction =
self.0.htc_vive_wrist_tracker_interaction && rhs.0.htc_vive_wrist_tracker_interaction; self.0.htc_vive_wrist_tracker_interaction && rhs.0.htc_vive_wrist_tracker_interaction;
out.htcx_vive_tracker_interaction = // out.htcx_vive_tracker_interaction =
self.0.htcx_vive_tracker_interaction && rhs.0.htcx_vive_tracker_interaction; // self.0.htcx_vive_tracker_interaction && rhs.0.htcx_vive_tracker_interaction;
out.huawei_controller_interaction = out.huawei_controller_interaction =
self.0.huawei_controller_interaction && rhs.0.huawei_controller_interaction; self.0.huawei_controller_interaction && rhs.0.huawei_controller_interaction;
out.khr_composition_layer_cube = out.khr_composition_layer_cube =
@@ -163,7 +173,7 @@ impl ops::BitAnd for XrExtensions {
out.mnd_swapchain_usage_input_attachment_bit = out.mnd_swapchain_usage_input_attachment_bit =
self.0.mnd_swapchain_usage_input_attachment_bit self.0.mnd_swapchain_usage_input_attachment_bit
&& rhs.0.mnd_swapchain_usage_input_attachment_bit; && rhs.0.mnd_swapchain_usage_input_attachment_bit;
out.mndx_egl_enable = self.0.mndx_egl_enable && rhs.0.mndx_egl_enable; // out.mndx_egl_enable = self.0.mndx_egl_enable && rhs.0.mndx_egl_enable;
out.msft_unbounded_reference_space = out.msft_unbounded_reference_space =
self.0.msft_unbounded_reference_space && rhs.0.msft_unbounded_reference_space; self.0.msft_unbounded_reference_space && rhs.0.msft_unbounded_reference_space;
out.msft_spatial_anchor = self.0.msft_spatial_anchor && rhs.0.msft_spatial_anchor; out.msft_spatial_anchor = self.0.msft_spatial_anchor && rhs.0.msft_spatial_anchor;

View File

@@ -50,8 +50,14 @@ impl XrInput {
// xr::Posef::IDENTITY, // xr::Posef::IDENTITY,
// )?; // )?;
let stage = let stage = match instance.exts().ext_local_floor {
session.create_reference_space(xr::ReferenceSpaceType::STAGE, xr::Posef::IDENTITY)?; None => session
.create_reference_space(xr::ReferenceSpaceType::STAGE, xr::Posef::IDENTITY)?,
Some(_) => session.create_reference_space(
xr::ReferenceSpaceType::LOCAL_FLOOR_EXT,
xr::Posef::IDENTITY,
)?,
};
let head = let head =
session.create_reference_space(xr::ReferenceSpaceType::VIEW, xr::Posef::IDENTITY)?; session.create_reference_space(xr::ReferenceSpaceType::VIEW, xr::Posef::IDENTITY)?;
// let y = stage // let y = stage

View File

@@ -11,6 +11,8 @@ use crate::{
use super::oculus_touch::ActionSets; use super::oculus_touch::ActionSets;
pub use xr::sys::NULL_PATH;
pub struct OpenXrActionsPlugin; pub struct OpenXrActionsPlugin;
impl Plugin for OpenXrActionsPlugin { impl Plugin for OpenXrActionsPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {