fix(openxr): Z order
This commit is contained in:
@@ -88,6 +88,7 @@ pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
|
||||
|
||||
Ok((xr_instance, system))
|
||||
}
|
||||
|
||||
pub(super) unsafe fn create_overlay_session(
|
||||
instance: &xr::Instance,
|
||||
system: xr::SystemId,
|
||||
|
||||
@@ -148,7 +148,6 @@ impl LinePool {
|
||||
1.0,
|
||||
)?)
|
||||
.eye_visibility(xr::EyeVisibility::BOTH)
|
||||
.layer_flags(xr::CompositionLayerFlags::CORRECT_CHROMATIC_ABERRATION)
|
||||
.space(&xr.stage)
|
||||
.size(xr::Extent2Df {
|
||||
width: LINE_WIDTH,
|
||||
|
||||
@@ -289,7 +289,8 @@ pub fn openxr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
|
||||
o.render(&mut app_state)?;
|
||||
|
||||
let dist_sq = (app_state.input_state.hmd.translation - o.state.transform.translation)
|
||||
.length_squared();
|
||||
.length_squared()
|
||||
+ (100f32 - o.state.z_order as f32);
|
||||
|
||||
if !dist_sq.is_normal() {
|
||||
continue;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use glam::Vec3A;
|
||||
use openxr as xr;
|
||||
use std::{f32::consts::PI, sync::Arc};
|
||||
use xr::{CompositionLayerFlags, EyeVisibility};
|
||||
use xr::EyeVisibility;
|
||||
|
||||
use super::{helpers, swapchain::SwapchainRenderData, CompositionLayer, XrState};
|
||||
use crate::{
|
||||
@@ -78,7 +78,6 @@ impl OverlayData<OpenXrOverlayData> {
|
||||
.pose(posef)
|
||||
.sub_image(sub_image)
|
||||
.eye_visibility(EyeVisibility::BOTH)
|
||||
.layer_flags(CompositionLayerFlags::CORRECT_CHROMATIC_ABERRATION)
|
||||
.space(&xr.stage)
|
||||
.radius(radius)
|
||||
.central_angle(angle)
|
||||
@@ -90,7 +89,6 @@ impl OverlayData<OpenXrOverlayData> {
|
||||
.pose(posef)
|
||||
.sub_image(sub_image)
|
||||
.eye_visibility(EyeVisibility::BOTH)
|
||||
.layer_flags(CompositionLayerFlags::CORRECT_CHROMATIC_ABERRATION)
|
||||
.space(&xr.stage)
|
||||
.size(xr::Extent2Df {
|
||||
width: scale_x,
|
||||
|
||||
Reference in New Issue
Block a user