Improve seapony tail animations

This commit is contained in:
Sollace 2023-08-21 21:25:04 +01:00
parent 72004812f2
commit 91918bab0c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 11 additions and 6 deletions

View file

@ -73,10 +73,7 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
leftFin.yaw = finAngle; leftFin.yaw = finAngle;
rightFin.yaw = -finAngle; rightFin.yaw = -finAngle;
if (!attributes.isSleeping) {
centerFin.roll = flapMotion; centerFin.roll = flapMotion;
}
if (!entity.isSubmergedInWater()) { if (!entity.isSubmergedInWater()) {
leftArm.pitch -= 0.5F; leftArm.pitch -= 0.5F;

View file

@ -17,8 +17,8 @@ public class SeaponyTail implements IPart, MsonModel {
public SeaponyTail(ModelPart tree) { public SeaponyTail(ModelPart tree) {
tailBase = tree.getChild("base"); tailBase = tree.getChild("base");
tailTip = tree.getChild("tip"); tailTip = tailBase.getChild("tip");
tailFins = tree.getChild("fins"); tailFins = tailTip.getChild("fins");
} }
@Override @Override
@ -28,6 +28,14 @@ public class SeaponyTail implements IPart, MsonModel {
tailBase.pitch = MathHelper.HALF_PI + rotation; tailBase.pitch = MathHelper.HALF_PI + rotation;
tailTip.pitch = rotation; tailTip.pitch = rotation;
tailFins.pitch = rotation - MathHelper.HALF_PI; tailFins.pitch = rotation - MathHelper.HALF_PI;
float turn = MathHelper.clamp(attributes.motionRoll * 0.05F + bodySwing, -0.4F, 0.4F);
tailBase.yaw = turn;
turn /= 2F;
tailTip.roll = -turn;
turn /= 2F;
tailFins.roll = -turn;
} }
@Override @Override