make OxrInitPlugin impl Default with the values from add_xr_plugin and made the ref_space_type public for the OxrReferenceSpacePlugin
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -61,6 +61,24 @@ pub struct OxrInitPlugin {
|
|||||||
/// Passed into the render plugin when added to the app.
|
/// Passed into the render plugin when added to the app.
|
||||||
pub synchronous_pipeline_compilation: bool,
|
pub synchronous_pipeline_compilation: bool,
|
||||||
}
|
}
|
||||||
|
impl Default for OxrInitPlugin {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
app_info: default(),
|
||||||
|
exts: {
|
||||||
|
let mut exts = OxrExtensions::default();
|
||||||
|
exts.enable_fb_passthrough();
|
||||||
|
exts.enable_hand_tracking();
|
||||||
|
exts
|
||||||
|
},
|
||||||
|
blend_modes: default(),
|
||||||
|
backends: default(),
|
||||||
|
formats: Some(vec![wgpu::TextureFormat::Rgba8UnormSrgb]),
|
||||||
|
resolutions: default(),
|
||||||
|
synchronous_pipeline_compilation: default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct OxrTrackingRoot;
|
pub struct OxrTrackingRoot;
|
||||||
@@ -172,7 +190,8 @@ impl Plugin for OxrInitPlugin {
|
|||||||
OxrPreUpdateSet::HandleEvents.after(handle_session),
|
OxrPreUpdateSet::HandleEvents.after(handle_session),
|
||||||
OxrPreUpdateSet::UpdateCriticalComponents,
|
OxrPreUpdateSet::UpdateCriticalComponents,
|
||||||
OxrPreUpdateSet::UpdateNonCriticalComponents,
|
OxrPreUpdateSet::UpdateNonCriticalComponents,
|
||||||
).chain(),
|
)
|
||||||
|
.chain(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let session_started = OxrSessionStarted::default();
|
let session_started = OxrSessionStarted::default();
|
||||||
@@ -399,7 +418,6 @@ fn init_xr_session(
|
|||||||
}
|
}
|
||||||
.ok_or(OxrError::NoAvailableBackend)?;
|
.ok_or(OxrError::NoAvailableBackend)?;
|
||||||
|
|
||||||
|
|
||||||
let graphics_info = OxrGraphicsInfo {
|
let graphics_info = OxrGraphicsInfo {
|
||||||
blend_mode,
|
blend_mode,
|
||||||
resolution,
|
resolution,
|
||||||
|
|||||||
@@ -36,20 +36,7 @@ pub fn add_xr_plugins<G: PluginGroup>(plugins: G) -> PluginGroupBuilder {
|
|||||||
.disable::<RenderPlugin>()
|
.disable::<RenderPlugin>()
|
||||||
.disable::<PipelinedRenderingPlugin>()
|
.disable::<PipelinedRenderingPlugin>()
|
||||||
.add_before::<RenderPlugin, _>(XrSessionPlugin)
|
.add_before::<RenderPlugin, _>(XrSessionPlugin)
|
||||||
.add_before::<RenderPlugin, _>(OxrInitPlugin {
|
.add_before::<RenderPlugin, _>(OxrInitPlugin::default())
|
||||||
app_info: default(),
|
|
||||||
exts: {
|
|
||||||
let mut exts = OxrExtensions::default();
|
|
||||||
exts.enable_fb_passthrough();
|
|
||||||
exts.enable_hand_tracking();
|
|
||||||
exts
|
|
||||||
},
|
|
||||||
blend_modes: default(),
|
|
||||||
backends: default(),
|
|
||||||
formats: Some(vec![wgpu::TextureFormat::Rgba8UnormSrgb]),
|
|
||||||
resolutions: default(),
|
|
||||||
synchronous_pipeline_compilation: default(),
|
|
||||||
})
|
|
||||||
.add(OxrReferenceSpacePlugin::default())
|
.add(OxrReferenceSpacePlugin::default())
|
||||||
.add(OxrRenderPlugin)
|
.add(OxrRenderPlugin)
|
||||||
.add(OxrPassthroughPlugin)
|
.add(OxrPassthroughPlugin)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use bevy_xr::session::{status_changed_to, XrStatus};
|
|||||||
use crate::{init::OxrPreUpdateSet, resources::OxrSession};
|
use crate::{init::OxrPreUpdateSet, resources::OxrSession};
|
||||||
|
|
||||||
pub struct OxrReferenceSpacePlugin {
|
pub struct OxrReferenceSpacePlugin {
|
||||||
default_primary_ref_space: openxr::ReferenceSpaceType,
|
pub default_primary_ref_space: openxr::ReferenceSpaceType,
|
||||||
}
|
}
|
||||||
impl Default for OxrReferenceSpacePlugin {
|
impl Default for OxrReferenceSpacePlugin {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
|||||||
Reference in New Issue
Block a user