Package codechicken.lib.model.pipeline
Class QuadTransformer
java.lang.Object
codechicken.lib.model.pipeline.QuadTransformer
- All Implemented Interfaces:
IVertexConsumer,IPipelineConsumer
- Direct Known Subclasses:
QuadAlphaOverride,QuadClamper,QuadCornerKicker,QuadFaceStripper,QuadReInterpolator,QuadTinter
Base class for a simple QuadTransformer.
Operates on BakedQuads.
QuadTransformers can be piped into each other at no performance penalty.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IVertexConsumerprotected CachedFormatprotected final Quad -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUsed for the BakedPipeline.QuadTransformer(CachedFormat format, IVertexConsumer consumer) QuadTransformer(IVertexConsumer consumer) QuadTransformer(com.mojang.blaze3d.vertex.VertexFormat format, IVertexConsumer consumer) -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanepsComp(float a, float b) com.mojang.blaze3d.vertex.VertexFormatvoidonFull()voidput(int element, float... data) voidAssumes the data is already completely unpacked.voidreset(CachedFormat format) Resets the Consumer to the new format.voidsetApplyDiffuseLighting(boolean diffuse) voidsetInputQuad(Quad quad) The quad at the start of the transformation.voidsetParent(IVertexConsumer parent) Sets the parent consumer.voidsetQuadOrientation(net.minecraft.core.Direction orientation) voidsetQuadTint(int tint) voidsetTexture(net.minecraft.client.renderer.texture.TextureAtlasSprite texture) abstract booleanCalled to transform the vertices.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.lib.model.IVertexConsumer
put
-
Field Details
-
quad
-
format
-
consumer
-
-
Constructor Details
-
QuadTransformer
protected QuadTransformer()Used for the BakedPipeline. -
QuadTransformer
-
QuadTransformer
-
QuadTransformer
-
-
Method Details
-
reset
Description copied from interface:IPipelineConsumerResets the Consumer to the new format. This should resize any internal arrays if needed, ready for the new vertex data.- Specified by:
resetin interfaceIPipelineConsumer- Parameters:
format- The format to reset to.
-
setParent
Description copied from interface:IPipelineConsumerSets 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:
setParentin interfaceIPipelineConsumer- Parameters:
parent- The parent.
-
setInputQuad
Description copied from interface:IPipelineConsumerThe quad at the start of the transformation. This is useful for obtaining the vertex data before any transformations have been applied, such as interpolation, SeeQuadReInterpolator. When overriding this make sure you call setInputQuad on your parent consumer too.- Specified by:
setInputQuadin interfaceIPipelineConsumer- Parameters:
quad- The quad.
-
getVertexFormat
public com.mojang.blaze3d.vertex.VertexFormat getVertexFormat()- Specified by:
getVertexFormatin interfaceIVertexConsumer
-
setQuadTint
public void setQuadTint(int tint) - Specified by:
setQuadTintin interfaceIVertexConsumer
-
setQuadOrientation
public void setQuadOrientation(net.minecraft.core.Direction orientation) - Specified by:
setQuadOrientationin interfaceIVertexConsumer
-
setApplyDiffuseLighting
public void setApplyDiffuseLighting(boolean diffuse) - Specified by:
setApplyDiffuseLightingin interfaceIVertexConsumer
-
setTexture
public void setTexture(net.minecraft.client.renderer.texture.TextureAtlasSprite texture) - Specified by:
setTexturein interfaceIVertexConsumer
-
put
public void put(int element, float... data) - Specified by:
putin interfaceIVertexConsumer
-
put
Description copied from interface:IVertexConsumerAssumes 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:
putin interfaceIVertexConsumer- 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)
-