diff options
author | BigBrotherNii <nicochr1004@gmail.com> | 2024-07-16 23:47:51 +0200 |
---|---|---|
committer | BigBrotherNii <nicochr1004@gmail.com> | 2024-07-16 23:47:51 +0200 |
commit | cd679169f8e049b3f3ce890c97d62fa72a4e4eb5 (patch) | |
tree | 4efaf40f3c818d79be881f81b7d8fa254861731d /pixel-client/src/helper.rs | |
parent | 2f9e2758199ff5148d7f90478be45aa122d6c860 (diff) | |
parent | df418c0d3fec83fc1cbe0dabc6d4b9dfbdbcbabb (diff) | |
download | hurrycurry-cd679169f8e049b3f3ce890c97d62fa72a4e4eb5.tar hurrycurry-cd679169f8e049b3f3ce890c97d62fa72a4e4eb5.tar.bz2 hurrycurry-cd679169f8e049b3f3ce890c97d62fa72a4e4eb5.tar.zst |
trying to merch qwq
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(); + } +} |