diff --git a/Cargo.lock b/Cargo.lock index 7d11602..4dccc73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2005,9 +2005,9 @@ dependencies = [ [[package]] name = "stardust-xr-molecules" -version = "0.22.0" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe2979f1816d21c3d1a88351f92e1a011992b166072a5fbc73221d6d4557a8e" +checksum = "44e840a893484f7c9445dde235090ad9cf829191f2bf2b913b5992cbf52ccbd8" dependencies = [ "color-rs", "glam 0.23.0", diff --git a/Cargo.toml b/Cargo.toml index a1cd0f8..a1e1c7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ regex = "1.7.1" resvg = "0.29.0" rustc-hash = "1.1.0" stardust-xr-fusion = "0.38.1" -stardust-xr-molecules = "0.22.0" +stardust-xr-molecules = "0.23.2" tokio = { version = "1.24.1", features = ["full"] } tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } tween = "2.0.0" diff --git a/examples/hexagon_launcher.rs b/examples/hexagon_launcher.rs index 318c68e..9b115bb 100644 --- a/examples/hexagon_launcher.rs +++ b/examples/hexagon_launcher.rs @@ -218,7 +218,13 @@ impl Button { } impl RootHandler for Button { fn frame(&mut self, info: FrameInfo) { - self.touch_plane.update(); self.grabbable.update(&info); + if self.grabbable.grab_action().actor_started() { + let _ = self.touch_plane.set_enabled(false); + } + if self.grabbable.grab_action().actor_stopped() { + let _ = self.touch_plane.set_enabled(true); + } + self.touch_plane.update(); } } diff --git a/src/protostar.rs b/src/protostar.rs index 71e773a..cda49e6 100644 --- a/src/protostar.rs +++ b/src/protostar.rs @@ -20,7 +20,7 @@ use std::process::{Command, Stdio}; use tween::{QuartInOut, Tweener}; const MODEL_SCALE: f32 = 0.03; -const ACTIVATION_DISTANCE: f32 = 1.0; +const ACTIVATION_DISTANCE: f32 = 0.5; fn model_from_icon(parent: &Spatial, icon: &Icon) -> Result { return match &icon.icon_type {