1declare_tween!(
2 pub struct QuintIn;
4
5 pub fn quint_in;
7
8 pub fn quint_in_at;
10
11 pub fn tween<Value: crate::TweenValue>(&mut self, value_delta: Value, percent: f32) -> Value {
12 value_delta.scale(percent * percent * percent * percent * percent)
13 }
14);
15
16declare_tween!(
17 pub struct QuintOut;
19
20 pub fn quint_out;
22
23 pub fn quint_out_at;
25
26 pub fn tween<Value: crate::TweenValue>(&mut self, value_delta: Value, mut percent: f32) -> Value {
27 percent -= 1.0;
28 value_delta.scale(percent * percent * percent * percent * percent + 1.0)
29 }
30);
31
32declare_tween!(
33 pub struct QuintInOut;
35
36 pub fn quint_in_out;
38
39 pub fn quint_in_out_at;
41
42 pub fn tween<Value: crate::TweenValue>(&mut self, value_delta: Value, mut percent: f32) -> Value {
43 percent *= 2.0;
44
45 let scalar = if percent < 1.0 {
46 percent * percent * percent * percent * percent
47 } else {
48 let p = percent - 2.0;
49 p * p * p * p * p + 2.0
50 };
51 value_delta.scale(scalar / 2.0)
52 }
53);
54
55test_tween!(Quint);