feat: update stardust-xr

This commit is contained in:
Nova
2022-12-17 02:29:32 -05:00
parent 6cdbfb3bad
commit 1833ed50f3
6 changed files with 18 additions and 18 deletions

View File

@@ -34,7 +34,7 @@ send_wrapper = "0.6.0"
prisma = "0.1.1" prisma = "0.1.1"
slog = "2.7.0" slog = "2.7.0"
xkbcommon = { version = "0.5.0", default-features = false, optional = true } xkbcommon = { version = "0.5.0", default-features = false, optional = true }
stardust-xr = "0.8.0" stardust-xr = "0.10.0"
directories = "4.0.1" directories = "4.0.1"
serde = { version = "1.0.145", features = ["derive"] } serde = { version = "1.0.145", features = ["derive"] }
tracing = "0.1.37" tracing = "0.1.37"

View File

@@ -2,6 +2,7 @@ use super::client::Client;
use color_eyre::eyre::Result; use color_eyre::eyre::Result;
use slab::Slab; use slab::Slab;
use stardust_xr::server; use stardust_xr::server;
use std::path::PathBuf;
use std::sync::atomic::AtomicU64; use std::sync::atomic::AtomicU64;
use std::sync::Arc; use std::sync::Arc;
use tokio::net::UnixListener; use tokio::net::UnixListener;
@@ -11,7 +12,7 @@ use tokio::task::JoinHandle;
pub static FRAME: AtomicU64 = AtomicU64::new(0); pub static FRAME: AtomicU64 = AtomicU64::new(0);
pub struct EventLoop { pub struct EventLoop {
pub socket_path: String, pub socket_path: PathBuf,
stop_notifier: Arc<Notify>, stop_notifier: Arc<Notify>,
pub clients: Mutex<Slab<Arc<Client>>>, pub clients: Mutex<Slab<Arc<Client>>>,
} }

View File

@@ -160,7 +160,10 @@ async fn event_loop(
let (event_loop, event_loop_join_handle) = let (event_loop, event_loop_join_handle) =
EventLoop::new().expect("Couldn't create server socket"); EventLoop::new().expect("Couldn't create server socket");
info!("Init event loop"); 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! { let result = tokio::select! {
biased; biased;

View File

@@ -267,11 +267,11 @@ impl Drop for Spatial {
pub fn parse_transform( pub fn parse_transform(
transform: Transform, transform: Transform,
translation: bool, position: bool,
rotation: bool, rotation: bool,
scale: bool, scale: bool,
) -> Result<Mat4> { ) -> Result<Mat4> {
let translation = translation let position = position
.then_some(transform.position) .then_some(transform.position)
.flatten() .flatten()
.unwrap_or_else(|| Vector3::from([0.0; 3])); .unwrap_or_else(|| Vector3::from([0.0; 3]));
@@ -287,7 +287,7 @@ pub fn parse_transform(
Ok(Mat4::from_scale_rotation_translation( Ok(Mat4::from_scale_rotation_translation(
scale.into(), scale.into(),
rotation.into(), rotation.into(),
translation.into(), position.into(),
)) ))
} }

View File

@@ -54,13 +54,10 @@ impl MousePointer {
if let Some(ray) = SkRay::from_mouse(mouse) { if let Some(ray) = SkRay::from_mouse(mouse) {
self.spatial.set_local_transform_components( self.spatial.set_local_transform_components(
None, None,
Transform { Transform::from_position_rotation(
position: Some(ray.pos), ray.pos,
rotation: Some( glam::Quat::from_rotation_arc(vec3(0.0, 0.0, 1.0), ray.dir.into()),
glam::Quat::from_rotation_arc(vec3(0.0, 0.0, 1.0), ray.dir.into()).into(), ),
),
scale: None,
},
); );
} }
{ {

View File

@@ -30,11 +30,10 @@ impl SkController {
if *self.tip.enabled.lock() { if *self.tip.enabled.lock() {
self.tip.spatial.set_local_transform_components( self.tip.spatial.set_local_transform_components(
None, None,
Transform { Transform::from_position_rotation(
position: Some(controller.pose.position), controller.pose.position,
rotation: Some(controller.pose.orientation), controller.pose.orientation,
scale: None, ),
},
); );
} }
let mut fbb = flexbuffers::Builder::default(); let mut fbb = flexbuffers::Builder::default();