Tanoda
Ease.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9namespace Leap.Unity.Animation {
10
12 public static class Ease {
13
14 public static class Quadratic {
15
18 public static float InOut(float t) {
19 t *= 2F;
20 if (t < 1F) return 0.5F * t * t;
21 t -= 1F;
22 return (-0.5F) * (t * (t - 2F) - 1F);
23 }
24
25 }
26
27 public static class Cubic {
28
31 public static float InOut(float t) {
32 t *= 2F;
33 if (t < 1F) return 0.5F * t * t * t;
34 t -= 2F;
35 return 0.5F * (t * t * t + 2F);
36 }
37
38 }
39
40 public static class Quartic {
41
44 public static float InOut(float t) {
45 t *= 2F;
46 if (t < 1F) return 0.5F * t * t * t * t;
47 t -= 2F;
48 return -0.5F * (t * t * t * t - 2F);
49 }
50
51 }
52
53 }
54
55}