ElytraModel.java
net.minecraft.client.model.object.equipment.ElytraModel
信息
- 全限定名:net.minecraft.client.model.object.equipment.ElytraModel
- 类型:public class
- 包:net.minecraft.client.model.object.equipment
- 源码路径:src/main/java/net/minecraft/client/model/object/equipment/ElytraModel.java
- 起始行号:L17
- 继承:EntityModel
- 职责:
TODO
字段/常量
-
BABY_TRANSFORMER- 类型:
MeshTransformer - 修饰符:
public static final - 源码定位:
L18 - 说明:
TODO
- 类型:
-
rightWing- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L19 - 说明:
TODO
- 类型:
-
leftWing- 类型:
ModelPart - 修饰符:
private final - 源码定位:
L20 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public ElytraModel(ModelPart root) @ L22
- 构造器名:ElytraModel
- 源码定位:L22
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createLayer() @ L28
- 方法名:createLayer
- 源码定位:L28
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- 无
说明:
TODO
public void setupAnim(HumanoidRenderState state) @ L45
- 方法名:setupAnim
- 源码定位:L45
- 返回类型:void
- 修饰符:public
参数:
- state: HumanoidRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class ElytraModel extends EntityModel<HumanoidRenderState> {
public static final MeshTransformer BABY_TRANSFORMER = MeshTransformer.scaling(0.5F);
private final ModelPart rightWing;
private final ModelPart leftWing;
public ElytraModel(ModelPart root) {
super(root);
this.leftWing = root.getChild("left_wing");
this.rightWing = root.getChild("right_wing");
}
public static LayerDefinition createLayer() {
MeshDefinition mesh = new MeshDefinition();
PartDefinition root = mesh.getRoot();
CubeDeformation windDeformation = new CubeDeformation(1.0F);
root.addOrReplaceChild(
"left_wing",
CubeListBuilder.create().texOffs(22, 0).addBox(-10.0F, 0.0F, 0.0F, 10.0F, 20.0F, 2.0F, windDeformation),
PartPose.offsetAndRotation(5.0F, 0.0F, 0.0F, (float) (Math.PI / 12), 0.0F, (float) (-Math.PI / 12))
);
root.addOrReplaceChild(
"right_wing",
CubeListBuilder.create().texOffs(22, 0).mirror().addBox(0.0F, 0.0F, 0.0F, 10.0F, 20.0F, 2.0F, windDeformation),
PartPose.offsetAndRotation(-5.0F, 0.0F, 0.0F, (float) (Math.PI / 12), 0.0F, (float) (Math.PI / 12))
);
return LayerDefinition.create(mesh, 64, 32);
}
public void setupAnim(HumanoidRenderState state) {
super.setupAnim(state);
this.leftWing.y = state.isCrouching ? 3.0F : 0.0F;
this.leftWing.xRot = state.elytraRotX;
this.leftWing.zRot = state.elytraRotZ;
this.leftWing.yRot = state.elytraRotY;
this.rightWing.yRot = -this.leftWing.yRot;
this.rightWing.y = this.leftWing.y;
this.rightWing.xRot = this.leftWing.xRot;
this.rightWing.zRot = -this.leftWing.zRot;
}
}引用的其他类
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offsetAndRotation()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
CubeDeformation()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
MeshTransformer.scaling()
- 引用位置:
-
- 引用位置:
参数
- 引用位置: