Class TransformUtils

java.lang.Object
codechicken.lib.util.TransformUtils

public class TransformUtils extends Object
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 Details

  • 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 vanilla ItemTransforms into a PerspectiveModelState.
      Parameters:
      itemTransforms - the ItemTransforms to 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 a PoseStack.
      Parameters:
      pStack - The PoseStack to apply to.