Files
server/src/objects/play_space.rs
2024-06-25 16:17:44 -04:00

27 lines
651 B
Rust

use stereokit_rust::system::World;
use zbus::{interface, Connection, ObjectServer};
pub struct PlaySpaceBounds;
impl PlaySpaceBounds {
pub async fn create(connection: &Connection) {
connection
.object_server()
.at("/org/stardustxr/PlaySpace", Self)
.await
.unwrap();
}
}
#[interface(name = "org.stardustxr.PlaySpace")]
impl PlaySpaceBounds {
#[zbus(property)]
fn bounds(&self) -> Vec<(f64, f64)> {
let bounds = World::get_bounds_size();
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()),
]
}
}