Class RenderUtils
java.lang.Object
me.desht.pneumaticcraft.client.util.RenderUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]decomposeColor(int color) Decompose a 32-bit color into ARGB 8-bit int valuesstatic float[]decomposeColorF(int color) static voiddrawTexture(com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int x, int y, float u1, float v1, float u2, float v2, int packedLightIn) static voiddrawTexture(com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int x, int y, int packedLightIn) static voidfinishBuffer(net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type) static voidnormalLine(com.mojang.blaze3d.vertex.VertexConsumer builder, org.joml.Matrix4f posMat, org.joml.Matrix3f normal, float x1, float y1, float z1, float x2, float y2, float z2, float a, float r, float g, float b, boolean isStrip) static com.mojang.blaze3d.vertex.VertexConsumerposF(com.mojang.blaze3d.vertex.VertexConsumer builder, org.joml.Matrix4f posMat, double x, double y, double z) Convenience method to get double coords intoVertexConsumer.vertex(Matrix4f, float, float, float)static net.minecraft.client.renderer.RenderTyperenderFrame(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.world.phys.AABB aabb, float fw, float r, float g, float b, float a, int packedLightIn, net.minecraft.core.Direction... sides) static voidrenderProgressingLine3d(ProgressingLine prev, ProgressingLine line, float partialTick, com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int color) static voidrenderRing(ProgressingLine line, ProgressingLine lastLine, com.mojang.blaze3d.vertex.PoseStack matrixStackIn, net.minecraft.client.renderer.MultiBufferSource bufferIn, float partialTick, float rotationYaw, float rotationPitch, int color) static voidrenderString3d(net.minecraft.network.chat.Component str, float x, float y, int color, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, boolean dropShadow, boolean disableDepthTest) static voidrenderString3d(net.minecraft.util.FormattedCharSequence str, float x, float y, int color, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, boolean dropShadow, boolean disableDepthTest) static voidrenderWithType(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type, BiConsumer<org.joml.Matrix4f, com.mojang.blaze3d.vertex.VertexConsumer> consumer) static voidrenderWithTypeAndFinish(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type, BiConsumer<org.joml.Matrix4f, com.mojang.blaze3d.vertex.VertexConsumer> consumer) static floatrotateMatrixForDirection(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.core.Direction facing) Rotates the render matrix dependant on the rotation of a block.static voidrotateToPlayerFacing(com.mojang.blaze3d.vertex.PoseStack matrixStack) Rotate the matrix so that subsequent drawing is oriented toward the player's facing.
-
Field Details
-
FULL_BRIGHT
public static final int FULL_BRIGHT- See Also:
-
-
Constructor Details
-
RenderUtils
public RenderUtils()
-
-
Method Details
-
decomposeColor
public static int[] decomposeColor(int color) Decompose a 32-bit color into ARGB 8-bit int values- Parameters:
color- color to decompose- Returns:
- 4-element array of ints
-
decomposeColorF
public static float[] decomposeColorF(int color) -
renderFrame
public static net.minecraft.client.renderer.RenderType renderFrame(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.world.phys.AABB aabb, float fw, float r, float g, float b, float a, int packedLightIn, net.minecraft.core.Direction... sides) -
rotateMatrixForDirection
public static float rotateMatrixForDirection(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.core.Direction facing) Rotates the render matrix dependant on the rotation of a block. Used by many block entity render methods.- Parameters:
matrixStack- the matrix stackfacing- block facing direction- Returns:
- the angle (in degrees) of resulting rotation around the Y axis
-
renderProgressingLine3d
public static void renderProgressingLine3d(ProgressingLine prev, ProgressingLine line, float partialTick, com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int color) -
renderRing
public static void renderRing(ProgressingLine line, ProgressingLine lastLine, com.mojang.blaze3d.vertex.PoseStack matrixStackIn, net.minecraft.client.renderer.MultiBufferSource bufferIn, float partialTick, float rotationYaw, float rotationPitch, int color) -
rotateToPlayerFacing
public static void rotateToPlayerFacing(com.mojang.blaze3d.vertex.PoseStack matrixStack) Rotate the matrix so that subsequent drawing is oriented toward the player's facing. Useful for drawing HUD elements in 3D space which need to face the player.- Parameters:
matrixStack- the matrix stack
-
drawTexture
public static void drawTexture(com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int x, int y, int packedLightIn) -
drawTexture
public static void drawTexture(com.mojang.blaze3d.vertex.PoseStack matrixStack, com.mojang.blaze3d.vertex.VertexConsumer builder, int x, int y, float u1, float v1, float u2, float v2, int packedLightIn) -
posF
public static com.mojang.blaze3d.vertex.VertexConsumer posF(com.mojang.blaze3d.vertex.VertexConsumer builder, org.joml.Matrix4f posMat, double x, double y, double z) Convenience method to get double coords intoVertexConsumer.vertex(Matrix4f, float, float, float)- Parameters:
builder- the vertex builderposMat- the positioning matrixx- Xy- Yz- Z- Returns:
- the vertex builder, for method chaining
-
finishBuffer
public static void finishBuffer(net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type) -
renderWithTypeAndFinish
public static void renderWithTypeAndFinish(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type, BiConsumer<org.joml.Matrix4f, com.mojang.blaze3d.vertex.VertexConsumer> consumer) -
renderWithType
public static void renderWithType(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, net.minecraft.client.renderer.RenderType type, BiConsumer<org.joml.Matrix4f, com.mojang.blaze3d.vertex.VertexConsumer> consumer) -
renderString3d
public static void renderString3d(net.minecraft.network.chat.Component str, float x, float y, int color, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, boolean dropShadow, boolean disableDepthTest) -
renderString3d
public static void renderString3d(net.minecraft.util.FormattedCharSequence str, float x, float y, int color, com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.renderer.MultiBufferSource buffer, boolean dropShadow, boolean disableDepthTest) -
normalLine
public static void normalLine(com.mojang.blaze3d.vertex.VertexConsumer builder, org.joml.Matrix4f posMat, org.joml.Matrix3f normal, float x1, float y1, float z1, float x2, float y2, float z2, float a, float r, float g, float b, boolean isStrip)
-