mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed head position and animation whilst swimming/crawling
This commit is contained in:
parent
b290d4c7e7
commit
833f11b4e9
2 changed files with 10 additions and 4 deletions
|
@ -207,6 +207,10 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
headPitch = Math.min(headPitch, (float) (0.5f - Math.toRadians(attributes.motionPitch)));
|
headPitch = Math.min(headPitch, (float) (0.5f - Math.toRadians(attributes.motionPitch)));
|
||||||
headPitch = Math.max(headPitch, (float) (-1.25f - Math.toRadians(attributes.motionPitch)));
|
headPitch = Math.max(headPitch, (float) (-1.25f - Math.toRadians(attributes.motionPitch)));
|
||||||
|
|
||||||
|
if (attributes.isSwimming) {
|
||||||
|
headPitch += 0.9F;
|
||||||
|
}
|
||||||
|
|
||||||
head.pitch = headPitch;
|
head.pitch = headPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,10 +262,12 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
*/
|
*/
|
||||||
protected void rotateLegsSwimming(float move, float swing, float ticks, T entity) {
|
protected void rotateLegsSwimming(float move, float swing, float ticks, T entity) {
|
||||||
|
|
||||||
float legLeft = (ROTATE_90 + MathHelper.sin((move / 3) + 2 * PI/3) / 2) * (float)attributes.motionLerp;
|
float lerp = entity.isSwimming() ? (float)attributes.motionLerp : 1;
|
||||||
|
|
||||||
float left = (ROTATE_90 + MathHelper.sin((move / 3) + 2 * PI) / 2) * (float)attributes.motionLerp;
|
float legLeft = (ROTATE_90 + MathHelper.sin((move / 3) + 2 * PI/3) / 2) * lerp;
|
||||||
float right = (ROTATE_90 + MathHelper.sin(move / 3) / 2) * (float)attributes.motionLerp;
|
|
||||||
|
float left = (ROTATE_90 + MathHelper.sin((move / 3) + 2 * PI) / 2) * lerp;
|
||||||
|
float right = (ROTATE_90 + MathHelper.sin(move / 3) / 2) * lerp;
|
||||||
|
|
||||||
leftArm.pitch = -left;
|
leftArm.pitch = -left;
|
||||||
leftArm.yaw = -left/2;
|
leftArm.yaw = -left/2;
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class Pony implements IPony {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSwimming(LivingEntity entity) {
|
public boolean isSwimming(LivingEntity entity) {
|
||||||
return entity.isSwimming();
|
return entity.isSwimming() || entity.isInSwimmingPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue