Search in sources :

Example 1 with IMultiModel

use of net.sistr.littlemaidmodelloader.multimodel.IMultiModel in project LittleMaidModelLoader-Fabric by SistrScarlet.

the class LMModelManager method getModel.

public Optional<IMultiModel> getModel(String modelName, IHasMultiModel.Layer layer) {
    ModelHolder modelHolder = models.get(modelName.toLowerCase());
    if (modelHolder == null)
        return Optional.empty();
    IMultiModel model = modelHolder.getModel(layer);
    return Optional.of(model);
}
Also used : IMultiModel(net.sistr.littlemaidmodelloader.multimodel.IMultiModel)

Example 2 with IMultiModel

use of net.sistr.littlemaidmodelloader.multimodel.IMultiModel 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

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