diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-16 23:38:46 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-16 23:38:46 +0200 |
commit | 775b0148cec4329a6abb19d03220dc1d8a8b68c3 (patch) | |
tree | 9e715df1db4f23a9c3f1e9c07cf7e93e376b512f /pixel-client/src/helper.rs | |
parent | 3a358c6dd39aa78319549658adf1028cea61f643 (diff) | |
download | hurrycurry-775b0148cec4329a6abb19d03220dc1d8a8b68c3.tar hurrycurry-775b0148cec4329a6abb19d03220dc1d8a8b68c3.tar.bz2 hurrycurry-775b0148cec4329a6abb19d03220dc1d8a8b68c3.tar.zst |
rename pixel client
Diffstat (limited to 'pixel-client/src/helper.rs')
-rw-r--r-- | pixel-client/src/helper.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pixel-client/src/helper.rs b/pixel-client/src/helper.rs new file mode 100644 index 00000000..9654f519 --- /dev/null +++ b/pixel-client/src/helper.rs @@ -0,0 +1,11 @@ +use hurrycurry_protocol::glam::Vec2; + +pub trait Vec2InterpolateExt { + fn exp_to(&mut self, target: Vec2, dt: f32); +} +impl Vec2InterpolateExt for Vec2 { + fn exp_to(&mut self, target: Vec2, dt: f32) { + self.x = target.x + (self.x - target.x) * (-dt).exp(); + self.y = target.y + (self.y - target.y) * (-dt).exp(); + } +} |