Removed unused functions

This commit is contained in:
nik012003
2023-07-24 15:01:16 +02:00
parent 6b4511bdd6
commit f90f737fb6
5 changed files with 16 additions and 30 deletions

View File

@@ -214,8 +214,7 @@ impl RootHandler for App {
.set_transform(Some(&root), Transform::identity())
.unwrap(); return};
let distance = Vec3::from(distance).length_squared();
dbg!(distance.sqrt());
dbg!(ACTIVATION_DISTANCE);
if distance > ACTIVATION_DISTANCE.powi(2) {
let _ = application.launch(&space);
}

View File

@@ -1,5 +1,5 @@
use color_eyre::eyre::Result;
use glam::Quat;
use glam::{Quat, Vec3};
use manifest_dir_macros::directory_relative_path;
use mint::Vector3;
use protostar::{
@@ -437,10 +437,9 @@ impl RootHandler for App {
//TODO: split the executable string for the args
tokio::task::spawn(async move {
let distance_vector = distance_future.await.ok().unwrap().0;
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
+ distance_vector.z.powi(2))
.sqrt();
if dbg!(distance) > ACTIVATION_DISTANCE {
let distance = Vec3::from(distance_vector).length_squared();
if distance > ACTIVATION_DISTANCE {
let _ = application.launch(&space);
}
});

View File

@@ -1,6 +1,6 @@
use clap::{self, Parser};
use color_eyre::eyre::Result;
use glam::Quat;
use glam::{Quat, Vec3};
use manifest_dir_macros::directory_relative_path;
use mint::Vector3;
use protostar::{
@@ -416,10 +416,9 @@ impl RootHandler for App {
//TODO: split the executable string for the args
tokio::task::spawn(async move {
let distance_vector = distance_future.await.ok().unwrap().0;
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
+ distance_vector.z.powi(2))
.sqrt();
if dbg!(distance) > ACTIVATION_DISTANCE {
let distance = Vec3::from(distance_vector).length_squared();
if distance > ACTIVATION_DISTANCE {
let _ = application.launch(&space);
}
});

View File

@@ -74,8 +74,11 @@ impl Application {
}
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 exec = re.replace_all(&executable, "");
unsafe {
Command::new("sh")
.arg("-c")

View File

@@ -3,7 +3,7 @@ use crate::{
xdg::{DesktopFile, Icon, IconType},
};
use color_eyre::eyre::Result;
use glam::Quat;
use glam::{Quat, Vec3};
use mint::Vector3;
use stardust_xr_fusion::{
client::{FrameInfo, RootHandler},
@@ -138,19 +138,6 @@ impl ProtoStar {
pub fn content_parent(&self) -> &Spatial {
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 {
fn frame(&mut self, info: FrameInfo) {
@@ -240,10 +227,9 @@ impl RootHandler for ProtoStar {
//TODO: split the executable string for the args
tokio::task::spawn(async move {
let distance_vector = distance_future.await.ok().unwrap().0;
let distance = ((distance_vector.x.powi(2) + distance_vector.y.powi(2)).sqrt()
+ distance_vector.z.powi(2))
.sqrt();
if dbg!(distance) > ACTIVATION_DISTANCE {
let distance = Vec3::from(distance_vector).length_squared();
if distance > ACTIVATION_DISTANCE {
let _ = application.launch(&space);
}
});