#Interpolating Baby Animal Model to Adult Model not working

4 messages · Page 1 of 1 (latest)

glass wadi
#

My mixins:

    @ModifyVariable(method = "render", at = @At(value = "STORE", ordinal = 0), ordinal = 4)
    private float scaleHead(float original) {
        return Math.lerp(original, 1, 1f - (float) TransitiveModelData.AGE / -24000);
    }

    @ModifyVariable(method = "render", at = @At(value = "STORE", ordinal = 1), ordinal = 4)
    private float scaleBody(float original) {
        return Math.lerp(original, 1, 1f - (float) TransitiveModelData.AGE / -24000);
    }

    @ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;translate(FFF)V", ordinal = 1), index = 1)
    private float translateBodyYOffsetWithAge(float yOffset) {
//        float constant = 1.0f / this.invertedChildBodyScale;
//        float original = Math.lerp(1.0f / this.invertedChildBodyScale, 1, 1f - (float) TransitiveModelData.AGE / -24000);
//        return yOffset * MathHelper.map(original, constant, 1, 1, 0);
        return Math.lerp(yOffset, 0, 1f - (float) TransitiveModelData.AGE / -24000);
    }

    @ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;translate(FFF)V", ordinal = 0), index = 1)
    private float translateHeadYOffWithAge(float yOffset) {
        return Math.lerp(yOffset, 0, 1f - (float) TransitiveModelData.AGE / -24000);
    }

    @ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;translate(FFF)V", ordinal = 0), index = 2)
    private float translateHeadZOffWithAge(float zOffset) {
        return Math.lerp(zOffset, 0, 1f - (float) TransitiveModelData.AGE / -24000);
    }
lofty sluice
#

Please make your title actually informative and don't name it "Smart Person Required!"

glass wadi
lofty sluice