PartPose.java

net.minecraft.client.model.geom.PartPose

信息

  • 全限定名:net.minecraft.client.model.geom.PartPose
  • 类型:public record
  • 包:net.minecraft.client.model.geom
  • 源码路径:src/main/java/net/minecraft/client/model/geom/PartPose.java
  • 起始行号:L7
  • 职责:

    TODO

字段/常量

  • ZERO
    • 类型: PartPose
    • 修饰符: public static final
    • 源码定位: L8
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

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

public static PartPose offset(float x, float y, float z) @ L10

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

参数:

  • x: float
  • y: float
  • z: float

说明:

TODO

public static PartPose rotation(float x, float y, float z) @ L14

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

参数:

  • x: float
  • y: float
  • z: float

说明:

TODO

public static PartPose offsetAndRotation(float offsetX, float offsetY, float offsetZ, float rotationX, float rotationY, float rotationZ) @ L18

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

参数:

  • offsetX: float
  • offsetY: float
  • offsetZ: float
  • rotationX: float
  • rotationY: float
  • rotationZ: float

说明:

TODO

public PartPose translated(float x, float y, float z) @ L22

  • 方法名:translated
  • 源码定位:L22
  • 返回类型:PartPose
  • 修饰符:public

参数:

  • x: float
  • y: float
  • z: float

说明:

TODO

public PartPose withScale(float scale) @ L26

  • 方法名:withScale
  • 源码定位:L26
  • 返回类型:PartPose
  • 修饰符:public

参数:

  • scale: float

说明:

TODO

public PartPose scaled(float factor) @ L30

  • 方法名:scaled
  • 源码定位:L30
  • 返回类型:PartPose
  • 修饰符:public

参数:

  • factor: float

说明:

TODO

public PartPose scaled(float scaleX, float scaleY, float scaleZ) @ L34

  • 方法名:scaled
  • 源码定位:L34
  • 返回类型:PartPose
  • 修饰符:public

参数:

  • scaleX: float
  • scaleY: float
  • scaleZ: float

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public record PartPose(float x, float y, float z, float xRot, float yRot, float zRot, float xScale, float yScale, float zScale) {
    public static final PartPose ZERO = offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
 
    public static PartPose offset(float x, float y, float z) {
        return offsetAndRotation(x, y, z, 0.0F, 0.0F, 0.0F);
    }
 
    public static PartPose rotation(float x, float y, float z) {
        return offsetAndRotation(0.0F, 0.0F, 0.0F, x, y, z);
    }
 
    public static PartPose offsetAndRotation(float offsetX, float offsetY, float offsetZ, float rotationX, float rotationY, float rotationZ) {
        return new PartPose(offsetX, offsetY, offsetZ, rotationX, rotationY, rotationZ, 1.0F, 1.0F, 1.0F);
    }
 
    public PartPose translated(float x, float y, float z) {
        return new PartPose(this.x + x, this.y + y, this.z + z, this.xRot, this.yRot, this.zRot, this.xScale, this.yScale, this.zScale);
    }
 
    public PartPose withScale(float scale) {
        return new PartPose(this.x, this.y, this.z, this.xRot, this.yRot, this.zRot, scale, scale, scale);
    }
 
    public PartPose scaled(float factor) {
        return factor == 1.0F ? this : this.scaled(factor, factor, factor);
    }
 
    public PartPose scaled(float scaleX, float scaleY, float scaleZ) {
        return new PartPose(
            this.x * scaleX,
            this.y * scaleY,
            this.z * scaleZ,
            this.xRot,
            this.yRot,
            this.zRot,
            this.xScale * scaleX,
            this.yScale * scaleY,
            this.zScale * scaleZ
        );
    }
}

引用的其他类