Removed unused functions
This commit is contained in:
@@ -214,8 +214,7 @@ impl RootHandler for App {
|
|||||||
.set_transform(Some(&root), Transform::identity())
|
.set_transform(Some(&root), Transform::identity())
|
||||||
.unwrap(); return};
|
.unwrap(); return};
|
||||||
let distance = Vec3::from(distance).length_squared();
|
let distance = Vec3::from(distance).length_squared();
|
||||||
dbg!(distance.sqrt());
|
|
||||||
dbg!(ACTIVATION_DISTANCE);
|
|
||||||
if distance > ACTIVATION_DISTANCE.powi(2) {
|
if distance > ACTIVATION_DISTANCE.powi(2) {
|
||||||
let _ = application.launch(&space);
|
let _ = application.launch(&space);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
use glam::Quat;
|
use glam::{Quat, Vec3};
|
||||||
use manifest_dir_macros::directory_relative_path;
|
use manifest_dir_macros::directory_relative_path;
|
||||||
use mint::Vector3;
|
use mint::Vector3;
|
||||||
use protostar::{
|
use protostar::{
|
||||||
@@ -437,10 +437,9 @@ impl RootHandler for App {
|
|||||||
//TODO: split the executable string for the args
|
//TODO: split the executable string for the args
|
||||||
tokio::task::spawn(async move {
|
tokio::task::spawn(async move {
|
||||||
let distance_vector = distance_future.await.ok().unwrap().0;
|
let distance_vector = distance_future.await.ok().unwrap().0;
|
||||||
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
|
let distance = Vec3::from(distance_vector).length_squared();
|
||||||
+ distance_vector.z.powi(2))
|
|
||||||
.sqrt();
|
if distance > ACTIVATION_DISTANCE {
|
||||||
if dbg!(distance) > ACTIVATION_DISTANCE {
|
|
||||||
let _ = application.launch(&space);
|
let _ = application.launch(&space);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use clap::{self, Parser};
|
use clap::{self, Parser};
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
use glam::Quat;
|
use glam::{Quat, Vec3};
|
||||||
use manifest_dir_macros::directory_relative_path;
|
use manifest_dir_macros::directory_relative_path;
|
||||||
use mint::Vector3;
|
use mint::Vector3;
|
||||||
use protostar::{
|
use protostar::{
|
||||||
@@ -416,10 +416,9 @@ impl RootHandler for App {
|
|||||||
//TODO: split the executable string for the args
|
//TODO: split the executable string for the args
|
||||||
tokio::task::spawn(async move {
|
tokio::task::spawn(async move {
|
||||||
let distance_vector = distance_future.await.ok().unwrap().0;
|
let distance_vector = distance_future.await.ok().unwrap().0;
|
||||||
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
|
let distance = Vec3::from(distance_vector).length_squared();
|
||||||
+ distance_vector.z.powi(2))
|
|
||||||
.sqrt();
|
if distance > ACTIVATION_DISTANCE {
|
||||||
if dbg!(distance) > ACTIVATION_DISTANCE {
|
|
||||||
let _ = application.launch(&space);
|
let _ = application.launch(&space);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -74,8 +74,11 @@ impl Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::env::set_var("STARDUST_STARTUP_TOKEN", startup_token);
|
std::env::set_var("STARDUST_STARTUP_TOKEN", startup_token);
|
||||||
|
|
||||||
|
// Strip/ignore field codes https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
|
||||||
let re = Regex::new(r"%[fFuUdDnNickvm]").unwrap();
|
let re = Regex::new(r"%[fFuUdDnNickvm]").unwrap();
|
||||||
let exec = re.replace_all(&executable, "");
|
let exec = re.replace_all(&executable, "");
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
Command::new("sh")
|
Command::new("sh")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use crate::{
|
|||||||
xdg::{DesktopFile, Icon, IconType},
|
xdg::{DesktopFile, Icon, IconType},
|
||||||
};
|
};
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
use glam::Quat;
|
use glam::{Quat, Vec3};
|
||||||
use mint::Vector3;
|
use mint::Vector3;
|
||||||
use stardust_xr_fusion::{
|
use stardust_xr_fusion::{
|
||||||
client::{FrameInfo, RootHandler},
|
client::{FrameInfo, RootHandler},
|
||||||
@@ -138,19 +138,6 @@ impl ProtoStar {
|
|||||||
pub fn content_parent(&self) -> &Spatial {
|
pub fn content_parent(&self) -> &Spatial {
|
||||||
self.grabbable.content_parent()
|
self.grabbable.content_parent()
|
||||||
}
|
}
|
||||||
pub fn toggle(&mut self) {
|
|
||||||
self.grabbable.set_enabled(!self.currently_shown).unwrap();
|
|
||||||
if self.currently_shown {
|
|
||||||
self.grabbable_move = Some(Tweener::quart_in_out(1.0, 0.0001, 0.25)); //TODO make the scale a parameter
|
|
||||||
} else {
|
|
||||||
self.icon.set_enabled(true).unwrap();
|
|
||||||
if let Some(label) = self.label.as_ref() {
|
|
||||||
label.set_enabled(true).unwrap()
|
|
||||||
}
|
|
||||||
self.grabbable_move = Some(Tweener::quart_in_out(0.0001, 1.0, 0.25));
|
|
||||||
}
|
|
||||||
self.currently_shown = !self.currently_shown;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
impl RootHandler for ProtoStar {
|
impl RootHandler for ProtoStar {
|
||||||
fn frame(&mut self, info: FrameInfo) {
|
fn frame(&mut self, info: FrameInfo) {
|
||||||
@@ -240,10 +227,9 @@ impl RootHandler for ProtoStar {
|
|||||||
//TODO: split the executable string for the args
|
//TODO: split the executable string for the args
|
||||||
tokio::task::spawn(async move {
|
tokio::task::spawn(async move {
|
||||||
let distance_vector = distance_future.await.ok().unwrap().0;
|
let distance_vector = distance_future.await.ok().unwrap().0;
|
||||||
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
|
let distance = Vec3::from(distance_vector).length_squared();
|
||||||
+ distance_vector.z.powi(2))
|
|
||||||
.sqrt();
|
if distance > ACTIVATION_DISTANCE {
|
||||||
if dbg!(distance) > ACTIVATION_DISTANCE {
|
|
||||||
let _ = application.launch(&space);
|
let _ = application.launch(&space);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user