aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/helper.rs
diff options
context:
space:
mode:
authorBigBrotherNii <nicochr1004@gmail.com>2024-07-16 23:47:51 +0200
committerBigBrotherNii <nicochr1004@gmail.com>2024-07-16 23:47:51 +0200
commitcd679169f8e049b3f3ce890c97d62fa72a4e4eb5 (patch)
tree4efaf40f3c818d79be881f81b7d8fa254861731d /pixel-client/src/helper.rs
parent2f9e2758199ff5148d7f90478be45aa122d6c860 (diff)
parentdf418c0d3fec83fc1cbe0dabc6d4b9dfbdbcbabb (diff)
downloadhurrycurry-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.rs11
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();
+ }
+}