java.lang.Object
org.hiedacamellia.immersiveui.client.graphic.util.IUIMathUtils

public class IUIMathUtils extends Object
IUIMathUtils 是一个数学工具类
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static org.joml.Vector4f
    int2ARGB(int color)
    将整数颜色值转换为 ARGB 格式的向量。
    static org.joml.Vector4f
    int2RGBA(int color)
    将整数颜色值转换为 RGBA 格式的向量。
    static double
    smoothPulse(double time, double duration, double riseFraction, double fallFraction)
    生成一个平滑的脉冲曲线。
    static float
    smoothPulse(float time, float duration, float riseFraction, float fallFraction)
    生成一个平滑的脉冲曲线。
    static double
    smoothStep(double start, double end, double v)
    使用 smoothstep 算法对给定的双精度值进行平滑插值。
    static float
    smoothStep(float start, float end, float v)
    使用 smoothstep 算法对给定的浮点值进行平滑插值。

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • IUIMathUtils

      public IUIMathUtils()
  • 方法详细资料

    • smoothStep

      public static float smoothStep(float start, float end, float v)
      使用 smoothstep 算法对给定的浮点值进行平滑插值。
      参数:
      start - 插值的起始值
      end - 插值的结束值
      v - 当前值
      返回:
      平滑插值后的值
    • smoothStep

      public static double smoothStep(double start, double end, double v)
      使用 smoothstep 算法对给定的双精度值进行平滑插值。
      参数:
      start - 插值的起始值
      end - 插值的结束值
      v - 当前值
      返回:
      平滑插值后的值
    • smoothPulse

      public static float smoothPulse(float time, float duration, float riseFraction, float fallFraction)
      生成一个平滑的脉冲曲线。

      曲线从 0 开始,在上升阶段平滑升至 1,在保持阶段维持 1, 在下降阶段平滑降至 0。内部使用 smoothStep(float, float, float) 实现平滑过渡。

      参数:
      time - 当前时间(>= 0)
      duration - 脉冲总时长(> 0)
      riseFraction - 上升阶段占总时长的比例(0 ~ 1)
      fallFraction - 下降阶段占总时长的比例(0 ~ 1)
      返回:
      0~1 之间的曲线值
    • smoothPulse

      public static double smoothPulse(double time, double duration, double riseFraction, double fallFraction)
      生成一个平滑的脉冲曲线。

      曲线从 0 开始,在上升阶段平滑升至 1,在保持阶段维持 1, 在下降阶段平滑降至 0。内部使用smoothStep(double, double, double) 实现平滑过渡。

      参数:
      time - 当前时间(>= 0)
      duration - 脉冲总时长(> 0)
      riseFraction - 上升阶段占总时长的比例(0 ~ 1)
      fallFraction - 下降阶段占总时长的比例(0 ~ 1)
      返回:
      0~1 之间的曲线值
    • int2RGBA

      public static org.joml.Vector4f int2RGBA(int color)
      将整数颜色值转换为 RGBA 格式的向量。
      参数:
      color - 整数颜色值
      返回:
      表示 RGBA 值的 Vector4f 对象
    • int2ARGB

      public static org.joml.Vector4f int2ARGB(int color)
      将整数颜色值转换为 ARGB 格式的向量。
      参数:
      color - 整数颜色值
      返回:
      表示 ARGB 值的 Vector4f 对象