Class QuadTransformer

java.lang.Object
codechicken.lib.model.pipeline.QuadTransformer
All Implemented Interfaces:
IVertexConsumer, IPipelineConsumer
Direct Known Subclasses:
QuadAlphaOverride, QuadClamper, QuadCornerKicker, QuadFaceStripper, QuadReInterpolator, QuadTinter

public abstract class QuadTransformer extends Object implements IVertexConsumer, IPipelineConsumer
Base class for a simple QuadTransformer. Operates on BakedQuads. QuadTransformers can be piped into each other at no performance penalty.
  • Field Details

  • Constructor Details

    • QuadTransformer

      protected QuadTransformer()
      Used for the BakedPipeline.
    • QuadTransformer

      public QuadTransformer(IVertexConsumer consumer)
    • QuadTransformer

      public QuadTransformer(com.mojang.blaze3d.vertex.VertexFormat format, IVertexConsumer consumer)
    • QuadTransformer

      public QuadTransformer(CachedFormat format, IVertexConsumer consumer)
  • Method Details

    • reset

      @OverridingMethodsMustInvokeSuper public void reset(CachedFormat format)
      Description copied from interface: IPipelineConsumer
      Resets the Consumer to the new format. This should resize any internal arrays if needed, ready for the new vertex data.
      Specified by:
      reset in interface IPipelineConsumer
      Parameters:
      format - The format to reset to.
    • setParent

      public void setParent(IVertexConsumer parent)
      Description copied from interface: IPipelineConsumer
      Sets the parent consumer. This consumer may choose to not pipe any data, that's fine, but if it does, it MUST pipe the data to the one provided here.
      Specified by:
      setParent in interface IPipelineConsumer
      Parameters:
      parent - The parent.
    • setInputQuad

      @OverridingMethodsMustInvokeSuper public void setInputQuad(Quad quad)
      Description copied from interface: IPipelineConsumer
      The quad at the start of the transformation. This is useful for obtaining the vertex data before any transformations have been applied, such as interpolation, See QuadReInterpolator. When overriding this make sure you call setInputQuad on your parent consumer too.
      Specified by:
      setInputQuad in interface IPipelineConsumer
      Parameters:
      quad - The quad.
    • getVertexFormat

      public com.mojang.blaze3d.vertex.VertexFormat getVertexFormat()
      Specified by:
      getVertexFormat in interface IVertexConsumer
    • setQuadTint

      public void setQuadTint(int tint)
      Specified by:
      setQuadTint in interface IVertexConsumer
    • setQuadOrientation

      public void setQuadOrientation(net.minecraft.core.Direction orientation)
      Specified by:
      setQuadOrientation in interface IVertexConsumer
    • setApplyDiffuseLighting

      public void setApplyDiffuseLighting(boolean diffuse)
      Specified by:
      setApplyDiffuseLighting in interface IVertexConsumer
    • setTexture

      public void setTexture(net.minecraft.client.renderer.texture.TextureAtlasSprite texture)
      Specified by:
      setTexture in interface IVertexConsumer
    • put

      public void put(int element, float... data)
      Specified by:
      put in interface IVertexConsumer
    • put

      public void put(Quad quad)
      Description copied from interface: IVertexConsumer
      Assumes the data is already completely unpacked. You must always copy the data from the quad provided to an internal cache. basically: this.quad.put(quad);
      Specified by:
      put in interface IVertexConsumer
      Parameters:
      quad - The quad to copy data from.
    • transform

      public abstract boolean transform()
      Called to transform the vertices.
      Returns:
      If the transformer should pipe the quad.
    • onFull

      public void onFull()
    • epsComp

      public static boolean epsComp(float a, float b)