refactor(openxr): make environment blend modes a completely runtime feature, like it should and remove the fb_passthrough plugin from the default oxr plugins as quests now support blendmode based passthrough

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-07-21 02:30:34 +02:00
committed by Schmarni
parent 9569f591ac
commit 62cf605f4a
13 changed files with 84 additions and 60 deletions

View File

@@ -11,9 +11,9 @@ use crate::resources::*;
use crate::session::OxrSession;
use crate::types::Result as OxrResult;
pub struct OxrPassthroughPlugin;
pub struct OxrFbPassthroughPlugin;
impl Plugin for OxrPassthroughPlugin {
impl Plugin for OxrFbPassthroughPlugin {
fn build(&self, app: &mut App) {
if app
.world()
@@ -94,12 +94,12 @@ pub fn supports_passthrough(instance: &OxrInstance, system: OxrSystemId) -> OxrR
return Ok(false);
}
unsafe {
let mut hand = openxr::sys::SystemPassthroughProperties2FB {
let mut properties = openxr::sys::SystemPassthroughProperties2FB {
ty: SystemPassthroughProperties2FB::TYPE,
next: std::ptr::null(),
capabilities: PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY,
};
let mut p = openxr::sys::SystemProperties::out(&mut hand as *mut _ as _);
let mut p = openxr::sys::SystemProperties::out(&mut properties as *mut _ as _);
cvt((instance.fp().get_system_properties)(
instance.as_raw(),
system.0,
@@ -107,10 +107,10 @@ pub fn supports_passthrough(instance: &OxrInstance, system: OxrSystemId) -> OxrR
))?;
bevy::log::info!(
"From supports_passthrough: Passthrough capabilities: {:?}",
hand.capabilities
properties.capabilities
);
Ok(
(hand.capabilities & PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY)
(properties.capabilities & PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY)
== PassthroughCapabilityFlagsFB::PASSTHROUGH_CAPABILITY,
)
}

View File

@@ -1,4 +1,4 @@
pub mod handtracking;
#[cfg(feature = "passthrough")]
pub mod passthrough;
pub mod fb_passthrough;
pub mod overlay;