类 IUIMathUtils
java.lang.Object
org.hiedacamellia.immersiveui.client.graphic.util.IUIMathUtils
IUIMathUtils 是一个数学工具类
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static org.joml.Vector4fint2ARGB(int color) 将整数颜色值转换为 ARGB 格式的向量。static org.joml.Vector4fint2RGBA(int color) 将整数颜色值转换为 RGBA 格式的向量。static doublesmoothPulse(double time, double duration, double riseFraction, double fallFraction) 生成一个平滑的脉冲曲线。static floatsmoothPulse(float time, float duration, float riseFraction, float fallFraction) 生成一个平滑的脉冲曲线。static doublesmoothStep(double start, double end, double v) 使用 smoothstep 算法对给定的双精度值进行平滑插值。static floatsmoothStep(float start, float end, float v) 使用 smoothstep 算法对给定的浮点值进行平滑插值。
-
构造器详细资料
-
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 对象
-