feat: make stage tracking space always available
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ use play_space::PlaySpaceBounds;
|
|||||||
use stardust_xr::schemas::dbus::object_registry::ObjectRegistry;
|
use stardust_xr::schemas::dbus::object_registry::ObjectRegistry;
|
||||||
use std::{
|
use std::{
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
sync::{atomic::Ordering, Arc},
|
sync::{Arc, atomic::Ordering},
|
||||||
};
|
};
|
||||||
use stereokit_rust::{
|
use stereokit_rust::{
|
||||||
material::Material,
|
material::Material,
|
||||||
@@ -65,10 +65,7 @@ impl ServerObjects {
|
|||||||
) -> ServerObjects {
|
) -> ServerObjects {
|
||||||
let hmd = SpatialRef::create(&connection, "/org/stardustxr/HMD");
|
let hmd = SpatialRef::create(&connection, "/org/stardustxr/HMD");
|
||||||
|
|
||||||
let play_space = (World::has_bounds()
|
let play_space = Some(SpatialRef::create(&connection, "/org/stardustxr/PlaySpace"));
|
||||||
&& World::get_bounds_size().x != 0.0
|
|
||||||
&& World::get_bounds_size().y != 0.0)
|
|
||||||
.then(|| SpatialRef::create(&connection, "/org/stardustxr/PlaySpace"));
|
|
||||||
if play_space.is_some() {
|
if play_space.is_some() {
|
||||||
let dbus_connection = connection.clone();
|
let dbus_connection = connection.clone();
|
||||||
tokio::task::spawn(async move {
|
tokio::task::spawn(async move {
|
||||||
|
|||||||
@@ -15,12 +15,19 @@ impl PlaySpaceBounds {
|
|||||||
impl PlaySpaceBounds {
|
impl PlaySpaceBounds {
|
||||||
#[zbus(property)]
|
#[zbus(property)]
|
||||||
fn bounds(&self) -> Vec<(f64, f64)> {
|
fn bounds(&self) -> Vec<(f64, f64)> {
|
||||||
let bounds = World::get_bounds_size();
|
if (World::has_bounds()
|
||||||
vec![
|
&& World::get_bounds_size().x != 0.0
|
||||||
((bounds.x).into(), (bounds.y).into()),
|
&& World::get_bounds_size().y != 0.0)
|
||||||
((bounds.x).into(), (-bounds.y).into()),
|
{
|
||||||
((-bounds.x).into(), (-bounds.y).into()),
|
let bounds = World::get_bounds_size();
|
||||||
((-bounds.x).into(), (bounds.y).into()),
|
vec![
|
||||||
]
|
((bounds.x).into(), (bounds.y).into()),
|
||||||
|
((bounds.x).into(), (-bounds.y).into()),
|
||||||
|
((-bounds.x).into(), (-bounds.y).into()),
|
||||||
|
((-bounds.x).into(), (bounds.y).into()),
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user