public class BufferBuilder extends DefaultColorVertexBuilder implements IVertexConsumer
Modifier and Type | Class and Description |
---|---|
static class |
BufferBuilder.DrawState |
static class |
BufferBuilder.State |
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
byteBuffer |
private int |
drawMode |
private int |
drawStateIndex |
private java.util.List<BufferBuilder.DrawState> |
drawStates |
private boolean |
fastFormat |
private boolean |
fullFormat |
private boolean |
isDrawing |
private static org.apache.logging.log4j.Logger |
LOGGER |
private int |
nextElementBytes |
private int |
renderedBytes |
private int |
uploadedBytes |
private int |
vertexCount |
private VertexFormat |
vertexFormat |
private VertexFormatElement |
vertexFormatElement |
private int |
vertexFormatIndex |
defaultAlpha, defaultBlue, defaultColor, defaultGreen, defaultRed
Constructor and Description |
---|
BufferBuilder(int bufferSizeIn) |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(float x,
float y,
float z,
float red,
float green,
float blue,
float alpha,
float texU,
float texV,
int overlayUV,
int lightmapUV,
float normalX,
float normalY,
float normalZ) |
void |
begin(int glMode,
VertexFormat format) |
IVertexBuilder |
color(int red,
int green,
int blue,
int alpha) |
void |
discard() |
void |
endVertex() |
void |
finishDrawing() |
VertexFormatElement |
getCurrentElement() |
private static float |
getDistanceSq(java.nio.FloatBuffer floatBufferIn,
float x,
float y,
float z,
int integerSize,
int offset) |
com.mojang.datafixers.util.Pair<BufferBuilder.DrawState,java.nio.ByteBuffer> |
getNextBuffer() |
VertexFormat |
getVertexFormat() |
BufferBuilder.State |
getVertexState() |
protected void |
growBuffer() |
private void |
growBuffer(int increaseAmount) |
boolean |
isDrawing() |
private void |
limitToVertex(java.nio.FloatBuffer floatBufferIn,
int indexIn) |
void |
nextVertexFormatIndex() |
void |
putBulkData(java.nio.ByteBuffer buffer) |
void |
putByte(int indexIn,
byte byteIn) |
void |
putFloat(int indexIn,
float floatIn) |
void |
putShort(int indexIn,
short shortIn) |
void |
reset() |
private static int |
roundUpPositive(int xIn) |
private void |
setVertexFormat(VertexFormat vertexFormatIn) |
void |
setVertexState(BufferBuilder.State state) |
void |
sortVertexData(float cameraX,
float cameraY,
float cameraZ) |
setDefaultColor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
lightmap, normal, normalInt, overlay, pos, tex, texShort
addQuad, addQuad, color, lightmap, normal, overlay, pos
addVertexData, addVertexData, addVertexData, addVertexData, applyBakedLighting, applyBakedNormals, getVertexBuilder
private static final org.apache.logging.log4j.Logger LOGGER
private java.nio.ByteBuffer byteBuffer
private final java.util.List<BufferBuilder.DrawState> drawStates
private int drawStateIndex
private int renderedBytes
private int nextElementBytes
private int uploadedBytes
private int vertexCount
@Nullable private VertexFormatElement vertexFormatElement
private int vertexFormatIndex
private int drawMode
private VertexFormat vertexFormat
private boolean fastFormat
private boolean fullFormat
private boolean isDrawing
protected void growBuffer()
private void growBuffer(int increaseAmount)
private static int roundUpPositive(int xIn)
public void sortVertexData(float cameraX, float cameraY, float cameraZ)
private void limitToVertex(java.nio.FloatBuffer floatBufferIn, int indexIn)
public BufferBuilder.State getVertexState()
private static float getDistanceSq(java.nio.FloatBuffer floatBufferIn, float x, float y, float z, int integerSize, int offset)
public void setVertexState(BufferBuilder.State state)
public void begin(int glMode, VertexFormat format)
private void setVertexFormat(VertexFormat vertexFormatIn)
public void finishDrawing()
public void putByte(int indexIn, byte byteIn)
putByte
in interface IVertexConsumer
public void putShort(int indexIn, short shortIn)
putShort
in interface IVertexConsumer
public void putFloat(int indexIn, float floatIn)
putFloat
in interface IVertexConsumer
public void endVertex()
endVertex
in interface IVertexBuilder
public void nextVertexFormatIndex()
nextVertexFormatIndex
in interface IVertexConsumer
public IVertexBuilder color(int red, int green, int blue, int alpha)
color
in interface IVertexBuilder
color
in interface IVertexConsumer
public void addVertex(float x, float y, float z, float red, float green, float blue, float alpha, float texU, float texV, int overlayUV, int lightmapUV, float normalX, float normalY, float normalZ)
addVertex
in interface IVertexBuilder
public com.mojang.datafixers.util.Pair<BufferBuilder.DrawState,java.nio.ByteBuffer> getNextBuffer()
public void reset()
public void discard()
public VertexFormatElement getCurrentElement()
getCurrentElement
in interface IVertexConsumer
public boolean isDrawing()
public void putBulkData(java.nio.ByteBuffer buffer)
public VertexFormat getVertexFormat()