From 2f1be10c37a3a18f4c0daab0ccc0a631d5877571 Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sat, 8 Nov 2025 14:30:24 -0500 Subject: [PATCH] feat: update dependencies to use local paths for StardustXR crates; enhance reify method to include Axes elements for tracked nodes --- bridge/Cargo.toml | 6 ++---- bridge/src/lib.rs | 28 +++++++++++++++++++++++++--- third_party/asteroids | 1 + third_party/core | 1 + 4 files changed, 29 insertions(+), 7 deletions(-) create mode 160000 third_party/asteroids create mode 160000 third_party/core diff --git a/bridge/Cargo.toml b/bridge/Cargo.toml index 0f34b4f..e02adf6 100644 --- a/bridge/Cargo.toml +++ b/bridge/Cargo.toml @@ -15,12 +15,10 @@ zbus = { version = "5.5.0", features = ["tokio"] } serde = { version = "1.0", features = ["derive"] } [dependencies.stardust-xr-asteroids] -git = "https://github.com/StardustXR/asteroids.git" -branch = "dev" +path = "../third_party/asteroids" [dependencies.stardust-xr-fusion] -git = "https://github.com/StardustXR/core.git" -branch = "dev" +path = "../third_party/core" [features] # Feature enabling real StardustXR integration when crates are present. diff --git a/bridge/src/lib.rs b/bridge/src/lib.rs index f35fd9b..4ea3d07 100644 --- a/bridge/src/lib.rs +++ b/bridge/src/lib.rs @@ -10,7 +10,7 @@ use glam::Mat4; use stardust_xr_asteroids as ast; // alias for brevity use stardust_xr_asteroids::{ client::ClientState, - elements::PlaySpace, + elements::{PlaySpace, Axes}, Migrate, Reify, }; use stardust_xr_asteroids::CustomElement; @@ -34,8 +34,30 @@ impl ClientState for BridgeState { impl Reify for BridgeState { fn reify(&self) -> impl ast::Element { - // Root playspace. We attach our dynamic nodes under this. - PlaySpace.build() + // Root playspace. Attach a visible Axes element per tracked node id. + // We read from the global CTRL so the element tree reflects the latest node registry. + let nodes = CTRL.lock().ok() + .map(|c| c.nodes.clone()) + .unwrap_or_default(); + + let children = nodes.into_iter().map(|(id, node)| { + // Decompose transform into TRS + let (scale, rot, trans) = node.transform.to_scale_rotation_translation(); + // Axes are small; apply a uniform visual scale multiplier based on TRS scale.x + let vis_scale = glam::Vec3::new(scale.x, scale.y, scale.z) * 0.2; + ( + id, + Axes::default() + .pos(trans) + .rot(rot) + .scl(vis_scale) + .build() + ) + }); + + PlaySpace + .build() + .stable_children(children) } } diff --git a/third_party/asteroids b/third_party/asteroids new file mode 160000 index 0000000..38ec7d0 --- /dev/null +++ b/third_party/asteroids @@ -0,0 +1 @@ +Subproject commit 38ec7d047076626396f6d5cde56ee8ff19eda8ee diff --git a/third_party/core b/third_party/core new file mode 160000 index 0000000..5176d1e --- /dev/null +++ b/third_party/core @@ -0,0 +1 @@ +Subproject commit 5176d1e9d26f1e8a4bd774519f3e7d1fddc121a9