mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-18 02:24:22 +01:00
Increase cuteness factor
This commit is contained in:
parent
4db4a239bd
commit
b4632c7358
1 changed files with 25 additions and 0 deletions
|
@ -3,6 +3,7 @@ package com.minelittlepony.client.model.part;
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
|
@ -25,6 +26,30 @@ public class PonyEars implements IPart, MsonModel {
|
||||||
head.addChild("left_ear_" + hashCode(), left);
|
head.addChild("left_ear_" + hashCode(), left);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPartAngles(ModelAttributes attributes, float limbAngle, float limbSpeed, float bodySwing, float animationProgress) {
|
||||||
|
right.resetTransform();
|
||||||
|
|
||||||
|
limbSpeed = MathHelper.clamp(limbSpeed, 0, 1);
|
||||||
|
|
||||||
|
float forwardFold = 0.14F * limbSpeed;
|
||||||
|
float sidewaysFlop = 0.11F * limbSpeed;
|
||||||
|
|
||||||
|
right.pitch = forwardFold;
|
||||||
|
left.pitch = forwardFold;
|
||||||
|
|
||||||
|
right.roll -= sidewaysFlop;
|
||||||
|
left.roll += sidewaysFlop;
|
||||||
|
|
||||||
|
float floppyness = Math.abs(MathHelper.sin(animationProgress / 99F));
|
||||||
|
if (floppyness > 0.99F) {
|
||||||
|
boolean leftFlop = MathHelper.sin(animationProgress / 5F) > 0.5F;
|
||||||
|
(leftFlop ? left : right).roll +=
|
||||||
|
0.01F * MathHelper.sin(animationProgress / 2F)
|
||||||
|
+ 0.015F * MathHelper.cos(animationProgress / 3F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, ModelAttributes attributes) {
|
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, ModelAttributes attributes) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue