ArrowModel.java
net.minecraft.client.model.object.projectile.ArrowModel
信息
- 全限定名:net.minecraft.client.model.object.projectile.ArrowModel
- 类型:public class
- 包:net.minecraft.client.model.object.projectile
- 源码路径:src/main/java/net/minecraft/client/model/object/projectile/ArrowModel.java
- 起始行号:L18
- 继承:EntityModel
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
public ArrowModel(ModelPart root) @ L19
- 构造器名:ArrowModel
- 源码定位:L19
- 修饰符:public
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createBodyLayer() @ L23
- 方法名:createBodyLayer
- 源码定位:L23
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- 无
说明:
TODO
public void setupAnim(ArrowRenderState state) @ L37
- 方法名:setupAnim
- 源码定位:L37
- 返回类型:void
- 修饰符:public
参数:
- state: ArrowRenderState
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class ArrowModel extends EntityModel<ArrowRenderState> {
public ArrowModel(ModelPart root) {
super(root, RenderTypes::entityCutoutCull);
}
public static LayerDefinition createBodyLayer() {
MeshDefinition mesh = new MeshDefinition();
PartDefinition root = mesh.getRoot();
root.addOrReplaceChild(
"back",
CubeListBuilder.create().texOffs(0, 0).addBox(0.0F, -2.5F, -2.5F, 0.0F, 5.0F, 5.0F),
PartPose.offsetAndRotation(-11.0F, 0.0F, 0.0F, (float) (Math.PI / 4), 0.0F, 0.0F).withScale(0.8F)
);
CubeListBuilder cross = CubeListBuilder.create().texOffs(0, 0).addBox(-12.0F, -2.0F, 0.0F, 16.0F, 4.0F, 0.0F, CubeDeformation.NONE, 1.0F, 0.8F);
root.addOrReplaceChild("cross_1", cross, PartPose.rotation((float) (Math.PI / 4), 0.0F, 0.0F));
root.addOrReplaceChild("cross_2", cross, PartPose.rotation((float) (Math.PI * 3.0 / 4.0), 0.0F, 0.0F));
return LayerDefinition.create(mesh.transformed(pose -> pose.scaled(0.9F)), 32, 32);
}
public void setupAnim(ArrowRenderState state) {
super.setupAnim(state);
if (state.shake > 0.0F) {
float pow = -Mth.sin(state.shake * 3.0F) * state.shake;
this.root.zRot += pow * (float) (Math.PI / 180.0);
}
}
}引用的其他类
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offsetAndRotation(), PartPose.rotation()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Mth.sin()
- 引用位置: