Package codechicken.lib.util
Class TransformUtils
java.lang.Object
codechicken.lib.util.TransformUtils
Created by covers1624 on 5/16/2016.
This is mostly just extracted from the ForgeBlockStateV1 in 1.10.
Credits to Fry.
If you have an idea for another transform just make a pull request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PerspectiveModelStatestatic final PerspectiveModelStatestatic final PerspectiveModelStatestatic final PerspectiveModelStatestatic final PerspectiveModelStatestatic final PerspectiveModelState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyLeftyFlip(com.mojang.blaze3d.vertex.PoseStack pStack) Deprecated, for removal: This API element is subject to removal in a future version.static com.mojang.math.Transformationcreate(float tx, float ty, float tz, float rx, float ry, float rz, float s) Creates a new TRSRTransformation.static com.mojang.math.TransformationCreates a new TRSRTransformation.static com.mojang.math.Transformationcreate(net.minecraft.client.renderer.block.model.ItemTransform transform) static com.mojang.math.Transformationcreate(org.joml.Vector3f transform, org.joml.Vector3f rotation, org.joml.Vector3f scale) Creates a new TRSRTransformation.static com.mojang.math.TransformationflipLeft(com.mojang.math.Transformation transform) Flips the transform for the left hand.static net.minecraft.client.resources.model.ModelStatestateFromItemTransforms(net.minecraft.client.renderer.block.model.ItemTransforms itemTransforms) Decompose a vanillaItemTransformsinto aPerspectiveModelState.
-
Field Details
-
IDENTITY
-
DEFAULT_BLOCK
-
DEFAULT_ITEM
-
DEFAULT_TOOL
-
DEFAULT_BOW
-
DEFAULT_HANDHELD_ROD
-
-
Constructor Details
-
TransformUtils
public TransformUtils()
-
-
Method Details
-
create
public static com.mojang.math.Transformation create(float tx, float ty, float tz, float rx, float ry, float rz, float s) Creates a new TRSRTransformation.- Parameters:
tx- The x transform.ty- The y transform.tz- The z transform.rx- The x Axis rotation.ry- The y Axis rotation.rz- The z Axis rotation.s- The scale.- Returns:
- The new TRSRTransformation.
-
create
public static com.mojang.math.Transformation create(Vector3 transform, Vector3 rotation, Vector3 scale) Creates a new TRSRTransformation.- Parameters:
transform- The transform.rotation- The rotation.scale- The scale.- Returns:
- The new TRSRTransformation.
-
create
public static com.mojang.math.Transformation create(org.joml.Vector3f transform, org.joml.Vector3f rotation, org.joml.Vector3f scale) Creates a new TRSRTransformation.- Parameters:
transform- The transform.rotation- The rotation.scale- The scale.- Returns:
- The new TRSRTransformation.
-
create
public static com.mojang.math.Transformation create(net.minecraft.client.renderer.block.model.ItemTransform transform) -
flipLeft
public static com.mojang.math.Transformation flipLeft(com.mojang.math.Transformation transform) Flips the transform for the left hand.- Parameters:
transform- The right-hand transform.- Returns:
- The new left-hand transform.
-
stateFromItemTransforms
public static net.minecraft.client.resources.model.ModelState stateFromItemTransforms(net.minecraft.client.renderer.block.model.ItemTransforms itemTransforms) Decompose a vanillaItemTransformsinto aPerspectiveModelState.- Parameters:
itemTransforms- theItemTransformsto decompose.- Returns:
- The
PerspectiveModelState
-
applyLeftyFlip
@Deprecated(forRemoval=true) public static void applyLeftyFlip(com.mojang.blaze3d.vertex.PoseStack pStack) Deprecated, for removal: This API element is subject to removal in a future version.Applies standard lefty flip to aPoseStack.- Parameters:
pStack- ThePoseStackto apply to.
-