From a6666646dd91114b236c17449c03b1c609e23de5 Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 15 Jan 2025 22:01:22 +0100 Subject: feat: contrib --- contrib/Containerfile | 2 ++ contrib/build-dev | 3 +++ contrib/build-prod | 3 +++ contrib/create-build-container | 3 +++ contrib/dev | 4 ++++ contrib/get-size | 4 ++++ 6 files changed, 19 insertions(+) create mode 100644 contrib/Containerfile create mode 100755 contrib/build-dev create mode 100755 contrib/build-prod create mode 100755 contrib/create-build-container create mode 100755 contrib/dev create mode 100755 contrib/get-size diff --git a/contrib/Containerfile b/contrib/Containerfile new file mode 100644 index 0000000..34f9e98 --- /dev/null +++ b/contrib/Containerfile @@ -0,0 +1,2 @@ +FROM alpine:edge +RUN apk add cargo sdl2-dev sdl2 upx clang diff --git a/contrib/build-dev b/contrib/build-dev new file mode 100755 index 0000000..ae5101d --- /dev/null +++ b/contrib/build-dev @@ -0,0 +1,3 @@ +#!/bin/sh +set -e +podman run --network=host --rm -v "$PWD:/app" --workdir /app -it docker.io/memdmp/cosin25-inv-builder sh -c 'cargo b' diff --git a/contrib/build-prod b/contrib/build-prod new file mode 100755 index 0000000..9ac994a --- /dev/null +++ b/contrib/build-prod @@ -0,0 +1,3 @@ +#!/bin/sh +set -e +podman run --network=host --rm -v "$PWD:/app:rw" --workdir /app -it docker.io/memdmp/cosin25-inv-builder ./build diff --git a/contrib/create-build-container b/contrib/create-build-container new file mode 100755 index 0000000..2e48f65 --- /dev/null +++ b/contrib/create-build-container @@ -0,0 +1,3 @@ +#!/bin/sh +set -e +podman build -f contrib/Containerfile -t docker.io/memdmp/cosin25-inv-builder \ No newline at end of file diff --git a/contrib/dev b/contrib/dev new file mode 100755 index 0000000..9f6c0ab --- /dev/null +++ b/contrib/dev @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +"$(dirname "$(realpath $0)")/build-dev" +target/debug/cosin-2025-invite-deck diff --git a/contrib/get-size b/contrib/get-size new file mode 100755 index 0000000..e7fe780 --- /dev/null +++ b/contrib/get-size @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +"$(dirname "$(realpath $0)")/build-prod" +wc -c target/release/cosin-2025-invite-deck -- cgit v1.2.3 From 4bc7eb4014ac32558e1eef8d3a43a5f5a80207e2 Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 15 Jan 2025 22:08:40 +0100 Subject: feat: unbind from frame rate --- src/main.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9855cdc..50320b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,8 +12,7 @@ use sdl2::rect::Rect; use sdl2::render::Texture; use sdl2::surface::Surface; use std::ops::DerefMut; -use std::sync::Arc; -use std::time::Duration; +use std::time::{Duration, SystemTime}; pub fn main() { let sdl_context = sdl2::init().unwrap(); @@ -34,16 +33,15 @@ pub fn main() { let mut i = 0; // amount to incr sin_offset by per frame - // TODO: do not bind to framerate u silly bean - let sin_speed = 0.0025; - let mut sin_offset = 0.5; + let start_time = SystemTime::now(); + let movement_per_second = 0.5; 'running: loop { + let time = SystemTime::now() + .duration_since(start_time) + .expect("Time went back between frames"); + let time = f64::from(time.as_millis() as u32) / 1000.0; i = (i + 1) % 255; - if sin_offset > 1.0 { - sin_offset -= 1.0; - } - canvas.set_draw_color(Color::RGB(12, 12, 12)); canvas.clear(); @@ -73,7 +71,7 @@ pub fn main() { let f64_w = f64::from(w); let f64_h = f64::from(h); let sin_x = { - let mut sin_x = f64::from(x) + (sin_offset * f64_w); + let mut sin_x = f64::from(x) + ((time * movement_per_second) * f64_w); if sin_x > f64_w { sin_x = sin_x - f64_w; } @@ -91,7 +89,6 @@ pub fn main() { f[idx + 3] = if sin_y < y as usize { 255 } else { 0 }; } } - sin_offset += sin_speed; let sin_texture = Texture::from_surface(&sin_surface, &texture_creator).unwrap(); @@ -125,6 +122,6 @@ pub fn main() { } // The rest of the game loop goes here... canvas.present(); - ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 120)); + ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 12000)); } } -- cgit v1.2.3 From dcc9baa255438bb0502918c2c581bed5f9e77d09 Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 15 Jan 2025 22:28:27 +0100 Subject: feat: render.rs --- src/main.rs | 84 ++++----------------------------------------------------- src/render.rs | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 79 deletions(-) create mode 100644 src/render.rs diff --git a/src/main.rs b/src/main.rs index 50320b7..29760d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,18 +2,12 @@ extern crate sdl2; mod font; pub mod generated; +mod render; -use font::BakedFont; -use generated::fonts::{FONT_CHERRY_BOMB_ONE, FONT_GALMURI}; -use sdl2::event::Event; -use sdl2::keyboard::Keycode; -use sdl2::pixels::{Color, PixelFormatEnum}; -use sdl2::rect::Rect; -use sdl2::render::Texture; -use sdl2::surface::Surface; -use std::ops::DerefMut; use std::time::{Duration, SystemTime}; +use sdl2::{event::Event, keyboard::Keycode}; + pub fn main() { let sdl_context = sdl2::init().unwrap(); let video_subsystem = sdl_context.video().unwrap(); @@ -30,86 +24,17 @@ pub fn main() { canvas.clear(); canvas.present(); let mut event_pump = sdl_context.event_pump().unwrap(); - let mut i = 0; // amount to incr sin_offset by per frame let start_time = SystemTime::now(); - let movement_per_second = 0.5; 'running: loop { let time = SystemTime::now() .duration_since(start_time) .expect("Time went back between frames"); let time = f64::from(time.as_millis() as u32) / 1000.0; - i = (i + 1) % 255; - - canvas.set_draw_color(Color::RGB(12, 12, 12)); - canvas.clear(); - - let mut offset: f32 = 0.0; - for c in "UwU-Space".chars() { - let char = FONT_CHERRY_BOMB_ONE.get_char(c); - canvas - .copy( - &char - .to_texture(&texture_creator, Color::RGB(i, 64, 255 - i)) - .unwrap(), - None, - char.to_rect(offset as i32 + 16, 16), - ) - .unwrap(); - offset += char.advance_width; - } - - { - let mut sin_surface = Surface::new(512, 256, PixelFormatEnum::RGBA32).unwrap(); - - let w = sin_surface.width(); - let h = sin_surface.height(); - let f = &mut sin_surface.deref_mut().without_lock_mut().unwrap(); - for x in 0..w { - let f64_w = f64::from(w); - let f64_h = f64::from(h); - let sin_x = { - let mut sin_x = f64::from(x) + ((time * movement_per_second) * f64_w); - if sin_x > f64_w { - sin_x = sin_x - f64_w; - } - sin_x - }; - let sin_y = - ((f64::sin(sin_x * (3.141 * 2.0) / f64_w) + 1.0) * (f64_h / 2.0)).floor() as usize; - // let sin_idx = (sin_y * w as usize + x as usize) * 4; + render::render(&mut canvas, &texture_creator, time); - for y in 0..h { - let idx = (y * w + x) as usize * 4; - f[idx] = 122 - (x / 8) as u8; - f[idx + 1] = 255 - (x / 2) as u8; - f[idx + 2] = (x / 2) as u8; - f[idx + 3] = if sin_y < y as usize { 255 } else { 0 }; - } - } - - let sin_texture = Texture::from_surface(&sin_surface, &texture_creator).unwrap(); - - canvas - .copy(&sin_texture, None, Rect::new(0, 0, 512, 256)) - .unwrap(); - } - offset = 0.0; - for c in "Come to Cosin25 :3".chars() { - let char = FONT_GALMURI.get_char(c); - canvas - .copy( - &char - .to_texture(&texture_creator, Color::RGB(i, 64, 255 - i)) - .unwrap(), - None, - char.to_rect(offset as i32 + 18, 16 + 36), - ) - .unwrap(); - offset += char.advance_width; - } for event in event_pump.poll_iter() { match event { Event::Quit { .. } @@ -120,6 +45,7 @@ pub fn main() { _ => {} } } + // The rest of the game loop goes here... canvas.present(); ::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 12000)); diff --git a/src/render.rs b/src/render.rs new file mode 100644 index 0000000..981bdd0 --- /dev/null +++ b/src/render.rs @@ -0,0 +1,87 @@ +use crate::font::BakedFont; +use crate::generated::fonts::{FONT_CHERRY_BOMB_ONE, FONT_GALMURI}; +use sdl2::pixels::{Color, PixelFormatEnum}; +use sdl2::rect::Rect; +use sdl2::render::{Canvas, Texture, TextureCreator}; +use sdl2::surface::Surface; +use sdl2::video::{Window, WindowContext}; +use std::ops::DerefMut; + +pub fn render( + canvas: &mut Canvas, + texture_creator: &TextureCreator, + time_seconds: f64, +) { + let movement_per_second = 0.5; + + let i = ((time_seconds * 60.0) % 255.0).round() as u8; + + canvas.set_draw_color(Color::RGB(12, 12, 12)); + canvas.clear(); + + let mut offset: f32 = 0.0; + for c in "UwU-Space".chars() { + let char = FONT_CHERRY_BOMB_ONE.get_char(c); + canvas + .copy( + &char + .to_texture(&texture_creator, Color::RGB(255, i, 255 - i)) + .unwrap(), + None, + char.to_rect(offset as i32 + 16, 16), + ) + .unwrap(); + offset += char.advance_width; + } + + { + let mut sin_surface = Surface::new(512, 256, PixelFormatEnum::RGBA32).unwrap(); + + let w = sin_surface.width(); + let h = sin_surface.height(); + let f = &mut sin_surface.deref_mut().without_lock_mut().unwrap(); + + for x in 0..w { + let f64_w = f64::from(w); + let f64_h = f64::from(h); + let sin_x = { + let mut sin_x = f64::from(x) + ((time_seconds * movement_per_second) * f64_w); + if sin_x > f64_w { + sin_x = sin_x - f64_w; + } + sin_x + }; + let sin_y = + ((f64::sin(sin_x * (3.141 * 2.0) / f64_w) + 1.0) * (f64_h / 2.0)).floor() as usize; + // let sin_idx = (sin_y * w as usize + x as usize) * 4; + + for y in 0..h { + let idx = (y * w + x) as usize * 4; + f[idx] = 122 - (x / 8) as u8; + f[idx + 1] = 255 - (x / 2) as u8; + f[idx + 2] = (x / 2) as u8; + f[idx + 3] = if sin_y < y as usize { 255 } else { 0 }; + } + } + + let sin_texture = Texture::from_surface(&sin_surface, &texture_creator).unwrap(); + + canvas + .copy(&sin_texture, None, Rect::new(0, 0, 512, 256)) + .unwrap(); + } + offset = 0.0; + for c in "Come to Cosin25 :3".chars() { + let char = FONT_GALMURI.get_char(c); + canvas + .copy( + &char + .to_texture(&texture_creator, Color::RGB(i, 64, 255 - i)) + .unwrap(), + None, + char.to_rect(offset as i32 + 18, 16 + 36), + ) + .unwrap(); + offset += char.advance_width; + } +} -- cgit v1.2.3 From 4ea043a85c6258262e4db3f93959f6fd5a128cfb Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 15 Jan 2025 22:29:22 +0100 Subject: feat: things --- src/main.rs | 5 +++-- src/render.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 29760d3..5a653cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,8 +20,9 @@ pub fn main() { let mut canvas = window.clone().into_canvas().build().unwrap(); let texture_creator = canvas.texture_creator(); - // let uwu_font = font::UwUFont::new(&texture_creator); - canvas.clear(); + + render::render(&mut canvas, &texture_creator, 0.001); + canvas.present(); let mut event_pump = sdl_context.event_pump().unwrap(); diff --git a/src/render.rs b/src/render.rs index 981bdd0..ab9e48e 100644 --- a/src/render.rs +++ b/src/render.rs @@ -53,7 +53,6 @@ pub fn render( }; let sin_y = ((f64::sin(sin_x * (3.141 * 2.0) / f64_w) + 1.0) * (f64_h / 2.0)).floor() as usize; - // let sin_idx = (sin_y * w as usize + x as usize) * 4; for y in 0..h { let idx = (y * w + x) as usize * 4; -- cgit v1.2.3 From 677017e3381df6de0f7fe4c236d7185a500b033d Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 16 Jan 2025 11:04:38 +0100 Subject: feat: oh god the horrors --- src/interpolation.rs | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 1 + src/render.rs | 1 + 3 files changed, 52 insertions(+) create mode 100644 src/interpolation.rs diff --git a/src/interpolation.rs b/src/interpolation.rs new file mode 100644 index 0000000..de6b6df --- /dev/null +++ b/src/interpolation.rs @@ -0,0 +1,50 @@ +use std::ops::{Add, Mul, Sub}; + +pub fn raw_lerp(a: T, b: T, t: f64) -> T +where + T: Copy + Add + Sub + Mul, +{ + a + (b - a) * t +} + +pub enum TimingFunction { + Lerp, +} +pub struct KeyFrame { + // We could make a TimeType generic (I initially did), however it's safe to assume we use a 64-bit float for this + pub time: f64, + pub val: ValueType, +} +impl KeyFrame { + pub fn new(time: f64, val: ValueType) -> KeyFrame { + KeyFrame { time, val } + } +} +impl< + ValueType: PartialOrd + + Copy + + Add + + Sub + + Mul, + > KeyFrame +{ + /** Simply passes the data to the timing function involved. Does not do bounding. */ + pub fn raw_value_at( + from: &KeyFrame, + to: &KeyFrame, + time: f64, + timing_function: TimingFunction, + ) -> ValueType { + // Order them so `from` is always the lower bound + let (from, to) = if from.time < to.time { + (from, to) + } else { + (to, from) + }; + let length = to.time - from.time; + let position = (time - from.time) / length; + match timing_function { + TimingFunction::Lerp => raw_lerp(from.val, to.val, position), + } + } +} diff --git a/src/main.rs b/src/main.rs index 5a653cd..f9c52f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ extern crate sdl2; mod font; pub mod generated; +mod interpolation; mod render; use std::time::{Duration, SystemTime}; diff --git a/src/render.rs b/src/render.rs index ab9e48e..c4d207f 100644 --- a/src/render.rs +++ b/src/render.rs @@ -1,5 +1,6 @@ use crate::font::BakedFont; use crate::generated::fonts::{FONT_CHERRY_BOMB_ONE, FONT_GALMURI}; +use crate::interpolation::KeyFrame; use sdl2::pixels::{Color, PixelFormatEnum}; use sdl2::rect::Rect; use sdl2::render::{Canvas, Texture, TextureCreator}; -- cgit v1.2.3 From d8fe5abc51c708367bca57493d1fd38142581ef9 Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 16 Jan 2025 12:21:04 +0100 Subject: feat: in theory this "works" --- src/interpolation.rs | 115 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/main.rs | 1 - 2 files changed, 112 insertions(+), 4 deletions(-) diff --git a/src/interpolation.rs b/src/interpolation.rs index de6b6df..d088bf8 100644 --- a/src/interpolation.rs +++ b/src/interpolation.rs @@ -1,4 +1,17 @@ -use std::ops::{Add, Mul, Sub}; +// NOTE: This entire file would need to be reworked to handle functions like bezier curves/any other fn involving multiple points. +// Someone should do this at some point. +// +// This likely would only be slightly breaking; ie the most commonly used portions of AnimationTrack would remain in-tact +// however, the internals of a KeyFrame would change immensely and be (more or less) impossible to keep + +use std::ops::{Add, Index, Mul, Sub}; + +// For when RFC1733 finally passes +// trait AcceptableValueType = PartialOrd +// + Copys +// + Add +// + Sub +// + Mul; pub fn raw_lerp(a: T, b: T, t: f64) -> T where @@ -7,11 +20,13 @@ where a + (b - a) * t } +#[derive(Clone, Copy)] pub enum TimingFunction { Lerp, } +#[derive(Clone, Copy, PartialEq, PartialOrd)] +// We could make a TimeType generic (I initially did), however it's safe to assume we use a 64-bit float for this pub struct KeyFrame { - // We could make a TimeType generic (I initially did), however it's safe to assume we use a 64-bit float for this pub time: f64, pub val: ValueType, } @@ -28,7 +43,9 @@ impl< + Mul, > KeyFrame { - /** Simply passes the data to the timing function involved. Does not do bounding. */ + /** + Simply passes the data to the timing function involved. Does not do bounding. + */ pub fn raw_value_at( from: &KeyFrame, to: &KeyFrame, @@ -48,3 +65,95 @@ impl< } } } + +#[derive(Clone)] +pub struct AnimationTrack { + pub keyframes: Vec>, + pub loop_count: u32, +} +impl AnimationTrack { + fn get_sorted_keyframes(&self) -> Vec> { + let mut kf = self.keyframes.clone(); + kf.sort_by(|a, b| a.time.total_cmp(&b.time)); + kf + } + fn get_first_last(&self) -> Option<(KeyFrame, KeyFrame)> { + let okf = self.get_sorted_keyframes(); + if okf.len() == 0 { + None + } else { + Some((*okf.first().unwrap(), *okf.last().unwrap())) + } + } + fn length(fl: (KeyFrame, KeyFrame)) -> f64 { + fl.1.time - fl.0.time + } +} +impl< + ValueType: PartialOrd + + Copy + + Add + + Sub + + Mul, + > AnimationTrack +{ + /** Get the 2 keyframes surrounding the current position in time. */ + fn get_current_keyframes( + &self, + // We have the user pass this, as to prevent needing to constantly re-calculate it. + sorted_keyframes: Vec>, + time: f64, + ) -> Option<(KeyFrame, KeyFrame)> { + // TODO: maybe refactor the internals of this to be faster + let idx = { + let mut idx = 0; + let mut found = false; + for f in &sorted_keyframes { + if f.time > time { + found = true; + break; + } else { + idx += 1; + } + } + if found { + Some(idx) + } else { + None + } + }; + match idx { + None => None, + Some(idx) => { + // If it's the last item, we don't have a 2nd + if idx + 1 == sorted_keyframes.len() { + None + } else { + Some(( + *sorted_keyframes.index(idx), + *sorted_keyframes.index(idx + 1), + )) + } + } + } + } + /** Gets the current value */ + pub fn get_current_value( + &self, + // We have the user pass this, as to prevent needing to constantly re-calculate it. + sorted_keyframes: Vec>, + time: f64, + timing_function: TimingFunction, + ) -> Option { + let frames = self.get_current_keyframes(sorted_keyframes, time); + match frames { + Some(frames) => Some(KeyFrame::raw_value_at( + &frames.0, + &frames.1, + time, + timing_function, + )), + None => None, + } + } +} diff --git a/src/main.rs b/src/main.rs index f9c52f9..c7a7606 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,7 +27,6 @@ pub fn main() { canvas.present(); let mut event_pump = sdl_context.event_pump().unwrap(); - // amount to incr sin_offset by per frame let start_time = SystemTime::now(); 'running: loop { let time = SystemTime::now() -- cgit v1.2.3 From 53cf1e9fb257e3fa351277c98b70e5244718d0db Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 16 Jan 2025 13:07:05 +0100 Subject: feat: what the fuck am i doing here --- src/interpolation.rs | 70 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/src/interpolation.rs b/src/interpolation.rs index d088bf8..17e4a48 100644 --- a/src/interpolation.rs +++ b/src/interpolation.rs @@ -104,35 +104,53 @@ impl< sorted_keyframes: Vec>, time: f64, ) -> Option<(KeyFrame, KeyFrame)> { - // TODO: maybe refactor the internals of this to be faster - let idx = { - let mut idx = 0; - let mut found = false; - for f in &sorted_keyframes { - if f.time > time { - found = true; - break; - } else { - idx += 1; - } - } - if found { - Some(idx) - } else { + let length = AnimationTrack::length(( + *sorted_keyframes.first().unwrap(), + *sorted_keyframes.last().unwrap(), + )); + // This can be removed if size restrictions call for it + match if time > length { + if time > length * f64::from(self.loop_count) { None + } else { + Some(time % length) } - }; - match idx { + } else { + Some(time) + } { None => None, - Some(idx) => { - // If it's the last item, we don't have a 2nd - if idx + 1 == sorted_keyframes.len() { - None - } else { - Some(( - *sorted_keyframes.index(idx), - *sorted_keyframes.index(idx + 1), - )) + Some(time) => { + // TODO: maybe refactor the internals of this to be faster + let idx = { + let mut idx = 0; + let mut found = false; + for f in &sorted_keyframes { + if f.time > time { + found = true; + break; + } else { + idx += 1; + } + } + if found { + Some(idx) + } else { + None + } + }; + match idx { + None => None, + Some(idx) => { + // If it's the last item, we don't have a 2nd + if idx + 1 == sorted_keyframes.len() { + None + } else { + Some(( + *sorted_keyframes.index(idx), + *sorted_keyframes.index(idx + 1), + )) + } + } } } } -- cgit v1.2.3 From dde982726272341a760cea068199b96c0e660f66 Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 16 Jan 2025 13:38:48 +0100 Subject: fix: i now hate life --- src/interpolation.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/interpolation.rs b/src/interpolation.rs index 17e4a48..4543ffb 100644 --- a/src/interpolation.rs +++ b/src/interpolation.rs @@ -21,9 +21,14 @@ where } #[derive(Clone, Copy)] -pub enum TimingFunction { +pub enum TwoValueTimingFunction { Lerp, } +#[derive(Clone, Copy)] +pub enum ManyValueTimingFunction { + Bezier, +} + #[derive(Clone, Copy, PartialEq, PartialOrd)] // We could make a TimeType generic (I initially did), however it's safe to assume we use a 64-bit float for this pub struct KeyFrame { @@ -50,7 +55,7 @@ impl< from: &KeyFrame, to: &KeyFrame, time: f64, - timing_function: TimingFunction, + timing_function: TwoValueTimingFunction, ) -> ValueType { // Order them so `from` is always the lower bound let (from, to) = if from.time < to.time { @@ -61,7 +66,7 @@ impl< let length = to.time - from.time; let position = (time - from.time) / length; match timing_function { - TimingFunction::Lerp => raw_lerp(from.val, to.val, position), + TwoValueTimingFunction::Lerp => raw_lerp(from.val, to.val, position), } } } @@ -161,7 +166,7 @@ impl< // We have the user pass this, as to prevent needing to constantly re-calculate it. sorted_keyframes: Vec>, time: f64, - timing_function: TimingFunction, + timing_function: TwoValueTimingFunction, ) -> Option { let frames = self.get_current_keyframes(sorted_keyframes, time); match frames { -- cgit v1.2.3 From 7fd1c555d1008a3d131d4acd5e3f0f7ca5b0e38c Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 16 Jan 2025 17:29:36 +0100 Subject: feat: temp --- src/interpolation.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/interpolation.rs b/src/interpolation.rs index 4543ffb..ecb2c85 100644 --- a/src/interpolation.rs +++ b/src/interpolation.rs @@ -19,6 +19,12 @@ where { a + (b - a) * t } +pub fn raw_bezier(v: Vec, t: f64) -> T +where + T: Copy + Add + Sub + Mul, +{ + todo!() +} #[derive(Clone, Copy)] pub enum TwoValueTimingFunction { -- cgit v1.2.3