UVPair.java
net.minecraft.client.model.geom.builders.UVPair
信息
- 全限定名:net.minecraft.client.model.geom.builders.UVPair
- 类型:public record
- 包:net.minecraft.client.model.geom.builders
- 源码路径:src/main/java/net/minecraft/client/model/geom/builders/UVPair.java
- 起始行号:L7
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public String toString() @ L8
- 方法名:toString
- 源码定位:L8
- 返回类型:String
- 修饰符:public
参数:
- 无
说明:
TODO
public static long pack(float u, float v) @ L13
- 方法名:pack
- 源码定位:L13
- 返回类型:long
- 修饰符:public static
参数:
- u: float
- v: float
说明:
TODO
public static float unpackU(long packedUV) @ L19
- 方法名:unpackU
- 源码定位:L19
- 返回类型:float
- 修饰符:public static
参数:
- packedUV: long
说明:
TODO
public static float unpackV(long packedUV) @ L24
- 方法名:unpackV
- 源码定位:L24
- 返回类型:float
- 修饰符:public static
参数:
- packedUV: long
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public record UVPair(float u, float v) {
@Override
public String toString() {
return "(" + this.u + "," + this.v + ")";
}
public static long pack(float u, float v) {
long high = Float.floatToIntBits(u) & 4294967295L;
long low = Float.floatToIntBits(v) & 4294967295L;
return high << 32 | low;
}
public static float unpackU(long packedUV) {
int bits = (int)(packedUV >> 32);
return Float.intBitsToFloat(bits);
}
public static float unpackV(long packedUV) {
return Float.intBitsToFloat((int)packedUV);
}
}引用的其他类
- 无