BabyFelineModel.java
net.minecraft.client.model.animal.feline.BabyFelineModel
信息
- 全限定名:net.minecraft.client.model.animal.feline.BabyFelineModel
- 类型:public class
- 包:net.minecraft.client.model.animal.feline
- 源码路径:src/main/java/net/minecraft/client/model/animal/feline/BabyFelineModel.java
- 起始行号:L15
- 继承:AbstractFelineModel
- 职责:
TODO
字段/常量
- 无
内部类/嵌套类型
- 无
构造器
protected BabyFelineModel(ModelPart root) @ L16
- 构造器名:BabyFelineModel
- 源码定位:L16
- 修饰符:protected
参数:
- root: ModelPart
说明:
TODO
方法
下面的方法块按源码顺序生成。
public static LayerDefinition createBabyLayer() @ L20
- 方法名:createBabyLayer
- 源码定位:L20
- 返回类型:LayerDefinition
- 修饰符:public static
参数:
- 无
说明:
TODO
public void setupAnim(S state) @ L60
- 方法名:setupAnim
- 源码定位:L60
- 返回类型:void
- 修饰符:public
参数:
- state: S
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class BabyFelineModel<S extends FelineRenderState> extends AbstractFelineModel<S> {
protected BabyFelineModel(ModelPart root) {
super(root);
}
public static LayerDefinition createBabyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();
partdefinition.addOrReplaceChild(
"head",
CubeListBuilder.create()
.texOffs(0, 0)
.addBox(-2.5F, -3.0F, -2.875F, 5.0F, 4.0F, 4.0F)
.texOffs(18, 0)
.addBox(-2.0F, -4.0F, -0.875F, 1.0F, 1.0F, 2.0F)
.texOffs(24, 0)
.addBox(1.0F, -4.0F, -0.875F, 1.0F, 1.0F, 2.0F)
.texOffs(18, 3)
.addBox(-1.5F, -1.0F, -3.875F, 3.0F, 2.0F, 1.0F),
PartPose.offset(0.0F, 20.0F, -3.125F)
);
partdefinition.addOrReplaceChild(
"left_front_leg", CubeListBuilder.create().texOffs(18, 18).addBox(-0.5F, 0.0F, -1.0F, 1.0F, 2.0F, 2.0F), PartPose.offset(1.0F, 22.0F, -1.5F)
);
partdefinition.addOrReplaceChild(
"right_front_leg", CubeListBuilder.create().texOffs(12, 18).addBox(-0.5F, 0.0F, -1.0F, 1.0F, 2.0F, 2.0F), PartPose.offset(-1.0F, 22.0F, -1.5F)
);
partdefinition.addOrReplaceChild(
"left_hind_leg", CubeListBuilder.create().texOffs(18, 22).addBox(-0.5F, 0.0F, -1.0F, 1.0F, 2.0F, 2.0F), PartPose.offset(1.0F, 22.0F, 2.5F)
);
partdefinition.addOrReplaceChild(
"body", CubeListBuilder.create().texOffs(0, 8).addBox(-2.0F, -1.5F, -3.5F, 4.0F, 3.0F, 7.0F), PartPose.offset(0.0F, 20.5F, 0.5F)
);
partdefinition.addOrReplaceChild(
"right_hind_leg", CubeListBuilder.create().texOffs(12, 22).addBox(-0.5F, 0.0F, -1.0F, 1.0F, 2.0F, 2.0F), PartPose.offset(-1.0F, 22.0F, 2.5F)
);
partdefinition.addOrReplaceChild(
"tail1",
CubeListBuilder.create().texOffs(0, 18).addBox(-0.5F, -0.107F, 0.0849F, 1.0F, 1.0F, 5.0F),
PartPose.offsetAndRotation(0.0F, 19.107F, 3.9151F, -0.567232F, 0.0F, 0.0F)
);
partdefinition.addOrReplaceChild("tail2", CubeListBuilder.create(), PartPose.ZERO);
return LayerDefinition.create(meshdefinition, 32, 32);
}
public void setupAnim(S state) {
super.setupAnim(state);
float ageScale = state.ageScale;
if (state.isCrouching) {
this.body.y += 1.0F * ageScale;
this.head.y += 2.0F * ageScale;
this.tail1.y += 1.0F * ageScale;
this.tail2.y += -4.0F * ageScale;
this.tail2.z += 2.0F * ageScale;
this.tail1.xRot = (float) (Math.PI / 2);
this.tail2.xRot = (float) (Math.PI / 2);
} else if (state.isSprinting) {
this.tail2.y = this.tail1.y;
this.tail2.z += 2.0F * ageScale;
this.tail1.xRot = (float) (Math.PI / 2);
this.tail2.xRot = (float) (Math.PI / 2);
}
this.head.xRot = state.xRot * (float) (Math.PI / 180.0);
this.head.yRot = state.yRot * (float) (Math.PI / 180.0);
if (!state.isSitting) {
float animationSpeed = state.walkAnimationSpeed;
float animationPos = state.walkAnimationPos;
if (state.isSprinting) {
this.leftHindLeg.xRot = Mth.cos(animationPos * 0.6662F) * animationSpeed;
this.rightHindLeg.xRot = Mth.cos(animationPos * 0.6662F + 0.3F) * animationSpeed;
this.leftFrontLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI + 0.3F) * animationSpeed;
this.rightFrontLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI) * animationSpeed;
this.tail2.xRot = 1.7278761F + (float) (Math.PI / 10) * Mth.cos(animationPos) * animationSpeed;
} else {
this.leftHindLeg.xRot = Mth.cos(animationPos * 0.6662F) * animationSpeed;
this.rightHindLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI) * animationSpeed;
this.leftFrontLeg.xRot = Mth.cos(animationPos * 0.6662F + (float) Math.PI) * animationSpeed;
this.rightFrontLeg.xRot = Mth.cos(animationPos * 0.6662F) * animationSpeed;
if (!state.isCrouching) {
this.tail2.xRot = 1.7278761F + (float) (Math.PI / 4) * Mth.cos(animationPos) * animationSpeed;
} else {
this.tail2.xRot = 1.7278761F + 0.47123894F * Mth.cos(animationPos) * animationSpeed;
}
}
} else if (state.isSitting) {
this.body.xRot += -0.43633232F;
this.body.y++;
this.head.z += 0.75F;
this.tail1.xRot += 0.5454154F;
this.tail1.y += 4.0F;
this.tail1.z -= 0.9F;
this.leftHindLeg.z -= 0.9F;
this.rightHindLeg.z -= 0.9F;
}
if (state.lieDownAmount > 0.0F) {
this.body.x++;
this.head.xRot = Mth.rotLerp(state.lieDownAmount, this.head.xRot, (float) (Math.PI / 18));
this.head.zRot = Mth.rotLerp(state.lieDownAmount, this.head.zRot, (float) (-Math.PI * 5.0 / 12.0));
this.head.x++;
this.head.y += 0.75F;
this.head.z -= 0.5F;
this.rightFrontLeg.xRot = (float) (-Math.PI / 4);
this.rightFrontLeg.x += 3.5F;
this.rightFrontLeg.y -= 0.5F;
this.rightFrontLeg.z += 0.0F;
this.leftFrontLeg.xRot = (float) (-Math.PI / 2);
this.leftFrontLeg.x++;
this.leftFrontLeg.y--;
this.leftFrontLeg.z -= 2.0F;
this.rightHindLeg.xRot = (float) (Math.PI * 2.0 / 9.0);
this.rightHindLeg.yRot = (float) (Math.PI / 9);
this.rightHindLeg.zRot = (float) (-Math.PI / 9);
this.rightHindLeg.x += 2.5F;
this.rightHindLeg.y -= 0.25F;
this.rightHindLeg.z += 0.5F;
this.leftHindLeg.x++;
this.leftHindLeg.z--;
this.tail1.xRot = this.tail1.xRot + Mth.rotLerp(state.lieDownAmountTail, this.tail1.xRot, (float) (-Math.PI / 6));
this.tail1.yRot = this.tail1.yRot + Mth.rotLerp(state.lieDownAmountTail, this.tail1.yRot, 0.0F);
this.tail1.zRot = this.tail1.zRot + Mth.rotLerp(state.lieDownAmountTail, this.tail1.zRot, (float) (-Math.PI / 18));
this.tail1.x++;
this.tail1.y += 0.5F;
this.tail1.z -= 0.25F;
}
if (state.relaxStateOneAmount > 0.0F) {
this.head.xRot = Mth.rotLerp(state.relaxStateOneAmount, this.head.xRot, -0.58177644F);
}
}
}引用的其他类
-
- 引用位置:
继承
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
PartPose.offset(), PartPose.offsetAndRotation()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CubeListBuilder.create()
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
LayerDefinition.create()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
MeshDefinition()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Mth.cos(), Mth.rotLerp()
- 引用位置: