diff --git a/src/animations.rs b/src/animations.rs index 2c454e7..01a2811 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -301,7 +301,7 @@ pub fn get_animation(name: &str, db: &State) -> Result struct AnimationId { animation: Animation, id: u8 - }; + } let next = stmt.query_map([name], |row| { Ok(AnimationId { @@ -370,7 +370,7 @@ pub fn get_animation(name: &str, db: &State) -> Result * */ #[get("/delete/")] -pub async fn delete(name: &str, start_sender: &State>, db: &State) -> String { +pub async fn delete(name: &str, db: &State) -> String { let animation = remove_animation(name, db); diff --git a/src/render.rs b/src/render.rs index 4aacf86..525b209 100644 --- a/src/render.rs +++ b/src/render.rs @@ -276,6 +276,9 @@ impl Render { to_clean.iter().for_each(|i| self.remove_animation(i.to_string())); if self.last.is_empty() || !self.last.clone().iter().eq(data.clone().iter()) { + + let lerp_data = data.iter().zip(self.last).map(|(d, l)| d - ((l - d) * 0.2)); + let err = self.ws.as_mut().unwrap().write(data.clone().into_iter()); if err.is_err() || err.ok().is_none() { diff --git a/src/utils.rs b/src/utils.rs index 1901568..ef736c9 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,4 @@ -use rocket::{serde::{Deserialize, Serialize}, Responder, http::{ContentType, Header}}; +use rocket::{serde::{Deserialize, Serialize}, Responder}; #[derive(Deserialize, Serialize)] #[serde(crate="rocket::serde")]