Ease.java

net.minecraft.util.Ease

信息

  • 全限定名:net.minecraft.util.Ease
  • 类型:public class
  • 包:net.minecraft.util
  • 源码路径:src/main/java/net/minecraft/util/Ease.java
  • 起始行号:L3
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public static float inBack(float x) @ L4

  • 方法名:inBack
  • 源码定位:L4
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inBounce(float x) @ L10

  • 方法名:inBounce
  • 源码定位:L10
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inCubic(float x) @ L14

  • 方法名:inCubic
  • 源码定位:L14
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inElastic(float x) @ L18

  • 方法名:inElastic
  • 源码定位:L18
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inExpo(float x) @ L29

  • 方法名:inExpo
  • 源码定位:L29
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inQuart(float x) @ L33

  • 方法名:inQuart
  • 源码定位:L33
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inQuint(float x) @ L37

  • 方法名:inQuint
  • 源码定位:L37
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inSine(float x) @ L41

  • 方法名:inSine
  • 源码定位:L41
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutBounce(float x) @ L45

  • 方法名:inOutBounce
  • 源码定位:L45
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutCirc(float x) @ L49

  • 方法名:inOutCirc
  • 源码定位:L49
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutCubic(float x) @ L55

  • 方法名:inOutCubic
  • 源码定位:L55
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutQuad(float x) @ L59

  • 方法名:inOutQuad
  • 源码定位:L59
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutQuart(float x) @ L63

  • 方法名:inOutQuart
  • 源码定位:L63
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutQuint(float x) @ L67

  • 方法名:inOutQuint
  • 源码定位:L67
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outBounce(float x) @ L71

  • 方法名:outBounce
  • 源码定位:L71
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outElastic(float x) @ L83

  • 方法名:outElastic
  • 源码定位:L83
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outExpo(float x) @ L92

  • 方法名:outExpo
  • 源码定位:L92
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outQuad(float x) @ L96

  • 方法名:outQuad
  • 源码定位:L96
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outQuint(float x) @ L100

  • 方法名:outQuint
  • 源码定位:L100
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outSine(float x) @ L104

  • 方法名:outSine
  • 源码定位:L104
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutSine(float x) @ L108

  • 方法名:inOutSine
  • 源码定位:L108
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outBack(float x) @ L112

  • 方法名:outBack
  • 源码定位:L112
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outQuart(float x) @ L118

  • 方法名:outQuart
  • 源码定位:L118
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outCubic(float x) @ L122

  • 方法名:outCubic
  • 源码定位:L122
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutExpo(float x) @ L126

  • 方法名:inOutExpo
  • 源码定位:L126
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inQuad(float x) @ L134

  • 方法名:inQuad
  • 源码定位:L134
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float outCirc(float x) @ L138

  • 方法名:outCirc
  • 源码定位:L138
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutElastic(float x) @ L142

  • 方法名:inOutElastic
  • 源码定位:L142
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inCirc(float x) @ L154

  • 方法名:inCirc
  • 源码定位:L154
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

public static float inOutBack(float x) @ L158

  • 方法名:inOutBack
  • 源码定位:L158
  • 返回类型:float
  • 修饰符:public static

参数:

  • x: float

说明:

TODO

代码

public class Ease {
    public static float inBack(float x) {
        float c1 = 1.70158F;
        float c3 = 2.70158F;
        return Mth.square(x) * (2.70158F * x - 1.70158F);
    }
 
    public static float inBounce(float x) {
        return 1.0F - outBounce(1.0F - x);
    }
 
    public static float inCubic(float x) {
        return Mth.cube(x);
    }
 
    public static float inElastic(float x) {
        if (x == 0.0F) {
            return 0.0F;
        } else if (x == 1.0F) {
            return 1.0F;
        } else {
            float c4 = (float) (Math.PI * 2.0 / 3.0);
            return (float)(-Math.pow(2.0, 10.0 * x - 10.0) * Math.sin((x * 10.0 - 10.75) * (float) (Math.PI * 2.0 / 3.0)));
        }
    }
 
    public static float inExpo(float x) {
        return x == 0.0F ? 0.0F : (float)Math.pow(2.0, 10.0 * x - 10.0);
    }
 
    public static float inQuart(float x) {
        return Mth.square(Mth.square(x));
    }
 
    public static float inQuint(float x) {
        return Mth.square(Mth.square(x)) * x;
    }
 
    public static float inSine(float x) {
        return 1.0F - Mth.cos(x * (float) (Math.PI / 2));
    }
 
    public static float inOutBounce(float x) {
        return x < 0.5F ? (1.0F - outBounce(1.0F - 2.0F * x)) / 2.0F : (1.0F + outBounce(2.0F * x - 1.0F)) / 2.0F;
    }
 
    public static float inOutCirc(float x) {
        return x < 0.5F
            ? (float)((1.0 - Math.sqrt(1.0 - Math.pow(2.0 * x, 2.0))) / 2.0)
            : (float)((Math.sqrt(1.0 - Math.pow(-2.0 * x + 2.0, 2.0)) + 1.0) / 2.0);
    }
 
    public static float inOutCubic(float x) {
        return x < 0.5F ? 4.0F * Mth.cube(x) : (float)(1.0 - Math.pow(-2.0 * x + 2.0, 3.0) / 2.0);
    }
 
    public static float inOutQuad(float x) {
        return x < 0.5F ? 2.0F * Mth.square(x) : (float)(1.0 - Math.pow(-2.0 * x + 2.0, 2.0) / 2.0);
    }
 
    public static float inOutQuart(float x) {
        return x < 0.5F ? 8.0F * Mth.square(Mth.square(x)) : (float)(1.0 - Math.pow(-2.0 * x + 2.0, 4.0) / 2.0);
    }
 
    public static float inOutQuint(float x) {
        return x < 0.5 ? 16.0F * x * x * x * x * x : (float)(1.0 - Math.pow(-2.0 * x + 2.0, 5.0) / 2.0);
    }
 
    public static float outBounce(float x) {
        float n1 = 7.5625F;
        float d1 = 2.75F;
        if (x < 0.36363637F) {
            return 7.5625F * Mth.square(x);
        } else if (x < 0.72727275F) {
            return 7.5625F * Mth.square(x - 0.54545456F) + 0.75F;
        } else {
            return x < 0.9090909090909091 ? 7.5625F * Mth.square(x - 0.8181818F) + 0.9375F : 7.5625F * Mth.square(x - 0.95454544F) + 0.984375F;
        }
    }
 
    public static float outElastic(float x) {
        float c4 = (float) (Math.PI * 2.0 / 3.0);
        if (x == 0.0F) {
            return 0.0F;
        } else {
            return x == 1.0F ? 1.0F : (float)(Math.pow(2.0, -10.0 * x) * Math.sin((x * 10.0 - 0.75) * (float) (Math.PI * 2.0 / 3.0)) + 1.0);
        }
    }
 
    public static float outExpo(float x) {
        return x == 1.0F ? 1.0F : 1.0F - (float)Math.pow(2.0, -10.0 * x);
    }
 
    public static float outQuad(float x) {
        return 1.0F - Mth.square(1.0F - x);
    }
 
    public static float outQuint(float x) {
        return 1.0F - (float)Math.pow(1.0 - x, 5.0);
    }
 
    public static float outSine(float x) {
        return Mth.sin(x * (float) (Math.PI / 2));
    }
 
    public static float inOutSine(float x) {
        return -(Mth.cos((float) Math.PI * x) - 1.0F) / 2.0F;
    }
 
    public static float outBack(float x) {
        float c1 = 1.70158F;
        float c3 = 2.70158F;
        return 1.0F + 2.70158F * Mth.cube(x - 1.0F) + 1.70158F * Mth.square(x - 1.0F);
    }
 
    public static float outQuart(float x) {
        return 1.0F - Mth.square(Mth.square(1.0F - x));
    }
 
    public static float outCubic(float x) {
        return 1.0F - Mth.cube(1.0F - x);
    }
 
    public static float inOutExpo(float x) {
        if (x < 0.5F) {
            return x == 0.0F ? 0.0F : (float)(Math.pow(2.0, 20.0 * x - 10.0) / 2.0);
        } else {
            return x == 1.0F ? 1.0F : (float)((2.0 - Math.pow(2.0, -20.0 * x + 10.0)) / 2.0);
        }
    }
 
    public static float inQuad(float x) {
        return x * x;
    }
 
    public static float outCirc(float x) {
        return (float)Math.sqrt(1.0F - Mth.square(x - 1.0F));
    }
 
    public static float inOutElastic(float x) {
        float c5 = (float) Math.PI * 4.0F / 9.0F;
        if (x == 0.0F) {
            return 0.0F;
        } else if (x == 1.0F) {
            return 1.0F;
        } else {
            double sin = Math.sin((20.0 * x - 11.125) * (float) Math.PI * 4.0F / 9.0F);
            return x < 0.5F ? (float)(-(Math.pow(2.0, 20.0 * x - 10.0) * sin) / 2.0) : (float)(Math.pow(2.0, -20.0 * x + 10.0) * sin / 2.0 + 1.0);
        }
    }
 
    public static float inCirc(float x) {
        return (float)(-Math.sqrt(1.0F - x * x)) + 1.0F;
    }
 
    public static float inOutBack(float x) {
        float c1 = 1.70158F;
        float c2 = 2.5949094F;
        if (x < 0.5F) {
            return 4.0F * x * x * (7.189819F * x - 2.5949094F) / 2.0F;
        } else {
            float dt = 2.0F * x - 2.0F;
            return (dt * dt * (3.5949094F * dt + 2.5949094F) + 2.0F) / 2.0F;
        }
    }
}

引用的其他类

  • Mth
    • 引用位置: 方法调用
    • 关联成员: Mth.cos(), Mth.cube(), Mth.sin(), Mth.square()