config: add use_passthrough
This commit is contained in:
@@ -147,7 +147,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
|
|||||||
stage_offset: Affine3A::IDENTITY,
|
stage_offset: Affine3A::IDENTITY,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
|
let mut skybox = if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|
||||||
|
|| !app_state.session.config.use_passthrough
|
||||||
|
{
|
||||||
create_skybox(&xr_state, &app_state)
|
create_skybox(&xr_state, &app_state)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
@@ -222,7 +224,9 @@ pub fn openxr_run(running: Arc<AtomicBool>, show_by_default: bool) -> Result<(),
|
|||||||
if main_session_visible {
|
if main_session_visible {
|
||||||
log::debug!("Destroying skybox.");
|
log::debug!("Destroying skybox.");
|
||||||
skybox = None;
|
skybox = None;
|
||||||
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE {
|
} else if environment_blend_mode == xr::EnvironmentBlendMode::OPAQUE
|
||||||
|
|| !app_state.session.config.use_passthrough
|
||||||
|
{
|
||||||
log::debug!("Allocating skybox.");
|
log::debug!("Allocating skybox.");
|
||||||
skybox = create_skybox(&xr_state, &app_state);
|
skybox = create_skybox(&xr_state, &app_state);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,6 +287,9 @@ pub struct GeneralConfig {
|
|||||||
#[serde(default = "def_true")]
|
#[serde(default = "def_true")]
|
||||||
pub use_skybox: bool,
|
pub use_skybox: bool,
|
||||||
|
|
||||||
|
#[serde(default = "def_true")]
|
||||||
|
pub use_passthrough: bool,
|
||||||
|
|
||||||
#[serde(default = "def_max_height")]
|
#[serde(default = "def_max_height")]
|
||||||
pub screen_max_height: u16,
|
pub screen_max_height: u16,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user