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);
}
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());
}
Aggregations