Class ModelBakeSettingsHelper
java.lang.Object
net.fabricmc.fabric.api.renderer.v1.model.ModelBakeSettingsHelper
Utilities to make it easier to work with
ModelState.-
Method Summary
Modifier and TypeMethodDescriptionstatic QuadTransformasQuadTransform(net.minecraft.client.resources.model.ModelState settings, SpriteFinderGetter spriteFinderGetter) Creates a newQuadTransformthat applies the given transformation.static net.minecraft.client.resources.model.ModelStatemultiply(net.minecraft.client.resources.model.ModelState left, net.minecraft.client.resources.model.ModelState right) Creates a newModelStatethat is the product of the two given settings.static net.minecraft.client.resources.model.ModelStateof(com.mojang.math.Transformation transformation, boolean uvLock) Creates a newModelStateusing the given transformation and enables UV lock if specified.
-
Method Details
-
of
public static net.minecraft.client.resources.model.ModelState of(com.mojang.math.Transformation transformation, boolean uvLock) Creates a newModelStateusing the given transformation and enables UV lock if specified. Works exactly likeBlockModelRotation, but allows an arbitrary transformation. Instances should be retained and reused, especially if UV lock is enabled, to avoid redoing costly computations. -
multiply
public static net.minecraft.client.resources.model.ModelState multiply(net.minecraft.client.resources.model.ModelState left, net.minecraft.client.resources.model.ModelState right) Creates a newModelStatethat is the product of the two given settings. Settings are represented by matrices, so this method follows the rules of matrix multiplication, namely that applying the resulting settings is (mostly) equivalent to applying the right settings and then the left settings. The only exception during standard application is cull face transformation, as the result must be clamped. Thus, applying a single premultiplied transformation generally yields better results than multiple applications. -
asQuadTransform
public static QuadTransform asQuadTransform(net.minecraft.client.resources.model.ModelState settings, SpriteFinderGetter spriteFinderGetter) Creates a newQuadTransformthat applies the given transformation. The sprite finder is used to look up the current sprite to correctly apply UV lock, if present in the transformation.This method is most useful when creating custom implementations of
UnbakedGeometry, which receive aModelState.
-