Search in sources :

Example 1 with IModelCaps

use of net.sistr.littlemaidmodelloader.maidmodel.IModelCaps in project LittleMaidModelLoader-Fabric by SistrScarlet.

the class MultiModelArmorLayer method renderArmorPart.

private void renderArmorPart(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch, IHasMultiModel.Part part) {
    if (!entity.isArmorVisible(part)) {
        return;
    }
    boolean glint = entity.isArmorGlint(part);
    IModelCaps caps = entity.getCaps();
    renderArmorLayer(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch, part, IHasMultiModel.Layer.INNER, false, caps, glint);
    renderArmorLayer(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch, part, IHasMultiModel.Layer.INNER, true, caps, glint);
    renderArmorLayer(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch, part, IHasMultiModel.Layer.OUTER, false, caps, glint);
    renderArmorLayer(matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch, part, IHasMultiModel.Layer.OUTER, true, caps, glint);
}
Also used : IModelCaps(net.sistr.littlemaidmodelloader.maidmodel.IModelCaps)

Example 2 with IModelCaps

use of net.sistr.littlemaidmodelloader.maidmodel.IModelCaps in project LittleMaidModelLoader-Fabric by SistrScarlet.

the class MultiModelEntity method getDimensions.

// このままだとEntityDimensionsが作っては捨てられてを繰り返すのでパフォーマンスはよろしくない
@Override
public EntityDimensions getDimensions(EntityPose pose) {
    EntityDimensions dimensions;
    IMultiModel model = getModel(Layer.SKIN, Part.HEAD).orElse(LMModelManager.INSTANCE.getDefaultModel());
    IModelCaps caps = getCaps();
    MMPose mmPose = MMPose.convertPose(pose);
    float height = model.getHeight(caps, mmPose);
    float width = model.getWidth(caps, mmPose);
    dimensions = EntityDimensions.changing(width, height);
    return dimensions.scaled(getScaleFactor());
}
Also used : IModelCaps(net.sistr.littlemaidmodelloader.maidmodel.IModelCaps) MMPose(net.sistr.littlemaidmodelloader.multimodel.layer.MMPose) IMultiModel(net.sistr.littlemaidmodelloader.multimodel.IMultiModel)

Aggregations

IModelCaps (net.sistr.littlemaidmodelloader.maidmodel.IModelCaps)2 IMultiModel (net.sistr.littlemaidmodelloader.multimodel.IMultiModel)1 MMPose (net.sistr.littlemaidmodelloader.multimodel.layer.MMPose)1