feat: update stardust-xr
This commit is contained in:
@@ -34,7 +34,7 @@ send_wrapper = "0.6.0"
|
||||
prisma = "0.1.1"
|
||||
slog = "2.7.0"
|
||||
xkbcommon = { version = "0.5.0", default-features = false, optional = true }
|
||||
stardust-xr = "0.8.0"
|
||||
stardust-xr = "0.10.0"
|
||||
directories = "4.0.1"
|
||||
serde = { version = "1.0.145", features = ["derive"] }
|
||||
tracing = "0.1.37"
|
||||
|
||||
@@ -2,6 +2,7 @@ use super::client::Client;
|
||||
use color_eyre::eyre::Result;
|
||||
use slab::Slab;
|
||||
use stardust_xr::server;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::AtomicU64;
|
||||
use std::sync::Arc;
|
||||
use tokio::net::UnixListener;
|
||||
@@ -11,7 +12,7 @@ use tokio::task::JoinHandle;
|
||||
pub static FRAME: AtomicU64 = AtomicU64::new(0);
|
||||
|
||||
pub struct EventLoop {
|
||||
pub socket_path: String,
|
||||
pub socket_path: PathBuf,
|
||||
stop_notifier: Arc<Notify>,
|
||||
pub clients: Mutex<Slab<Arc<Client>>>,
|
||||
}
|
||||
|
||||
@@ -160,7 +160,10 @@ async fn event_loop(
|
||||
let (event_loop, event_loop_join_handle) =
|
||||
EventLoop::new().expect("Couldn't create server socket");
|
||||
info!("Init event loop");
|
||||
info!("Stardust socket created at {}", event_loop.socket_path);
|
||||
info!(
|
||||
"Stardust socket created at {}",
|
||||
event_loop.socket_path.display()
|
||||
);
|
||||
|
||||
let result = tokio::select! {
|
||||
biased;
|
||||
|
||||
@@ -267,11 +267,11 @@ impl Drop for Spatial {
|
||||
|
||||
pub fn parse_transform(
|
||||
transform: Transform,
|
||||
translation: bool,
|
||||
position: bool,
|
||||
rotation: bool,
|
||||
scale: bool,
|
||||
) -> Result<Mat4> {
|
||||
let translation = translation
|
||||
let position = position
|
||||
.then_some(transform.position)
|
||||
.flatten()
|
||||
.unwrap_or_else(|| Vector3::from([0.0; 3]));
|
||||
@@ -287,7 +287,7 @@ pub fn parse_transform(
|
||||
Ok(Mat4::from_scale_rotation_translation(
|
||||
scale.into(),
|
||||
rotation.into(),
|
||||
translation.into(),
|
||||
position.into(),
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
@@ -54,13 +54,10 @@ impl MousePointer {
|
||||
if let Some(ray) = SkRay::from_mouse(mouse) {
|
||||
self.spatial.set_local_transform_components(
|
||||
None,
|
||||
Transform {
|
||||
position: Some(ray.pos),
|
||||
rotation: Some(
|
||||
glam::Quat::from_rotation_arc(vec3(0.0, 0.0, 1.0), ray.dir.into()).into(),
|
||||
),
|
||||
scale: None,
|
||||
},
|
||||
Transform::from_position_rotation(
|
||||
ray.pos,
|
||||
glam::Quat::from_rotation_arc(vec3(0.0, 0.0, 1.0), ray.dir.into()),
|
||||
),
|
||||
);
|
||||
}
|
||||
{
|
||||
|
||||
@@ -30,11 +30,10 @@ impl SkController {
|
||||
if *self.tip.enabled.lock() {
|
||||
self.tip.spatial.set_local_transform_components(
|
||||
None,
|
||||
Transform {
|
||||
position: Some(controller.pose.position),
|
||||
rotation: Some(controller.pose.orientation),
|
||||
scale: None,
|
||||
},
|
||||
Transform::from_position_rotation(
|
||||
controller.pose.position,
|
||||
controller.pose.orientation,
|
||||
),
|
||||
);
|
||||
}
|
||||
let mut fbb = flexbuffers::Builder::default();
|
||||
|
||||
Reference in New Issue
Block a user