Package com.mojang.blaze3d.vertex
Class BufferBuilder
java.lang.Object
com.mojang.blaze3d.vertex.BufferBuilder
- All Implemented Interfaces:
VertexConsumer
,IVertexConsumerExtension
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferBuilder
private boolean
private int
private final boolean
private final VertexFormat
private final boolean
private final int
private static final boolean
private final VertexFormat.Mode
private static final long
private final int[]
private static final long
private long
private final int
private int
-
Constructor Summary
ConstructorsConstructorDescriptionBufferBuilder
(ByteBufferBuilder buffer, VertexFormat.Mode mode, VertexFormat format) -
Method Summary
Modifier and TypeMethodDescriptionaddVertex
(float x, float y, float z) void
addVertex
(float x, float y, float z, int color, float u, float v, int packedOverlay, int packedLight, float normalX, float normalY, float normalZ) private long
beginElement
(VertexFormatElement element) private long
build()
private void
private void
private static byte
normalIntValue
(float value) private static void
putPackedUv
(long pointer, int packedUv) private static void
putRgba
(long pointer, int color) setColor
(int color) setColor
(int red, int green, int blue, int alpha) setLight
(int packedLight) setNormal
(float normalX, float normalY, float normalZ) setOverlay
(int packedOverlay) setUv
(float u, float v) setUv1
(int u, int v) setUv2
(int u, int v) private MeshData
private VertexConsumer
uvShort
(short u, short v, VertexFormatElement element) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IVertexConsumerExtension
applyBakedLighting, applyBakedNormals, misc, putBulkData
Methods inherited from interface com.mojang.blaze3d.vertex.VertexConsumer
addVertex, addVertex, addVertex, addVertex, putBulkData, putBulkData, setColor, setNormal, setWhiteAlpha
-
Field Details
-
NOT_BUILDING
private static final long NOT_BUILDING- See Also:
-
UNKNOWN_ELEMENT
private static final long UNKNOWN_ELEMENT- See Also:
-
IS_LITTLE_ENDIAN
private static final boolean IS_LITTLE_ENDIAN -
buffer
-
vertexPointer
private long vertexPointer -
vertices
private int vertices -
format
-
mode
-
fastFormat
private final boolean fastFormat -
fullFormat
private final boolean fullFormat -
vertexSize
private final int vertexSize -
initialElementsToFill
private final int initialElementsToFill -
offsetsByElement
private final int[] offsetsByElement -
elementsToFill
private int elementsToFill -
building
private boolean building
-
-
Constructor Details
-
BufferBuilder
-
-
Method Details
-
build
-
buildOrThrow
-
ensureBuilding
private void ensureBuilding() -
storeMesh
-
beginVertex
private long beginVertex() -
beginElement
-
endLastVertex
private void endLastVertex() -
putRgba
private static void putRgba(long pointer, int color) -
putPackedUv
private static void putPackedUv(long pointer, int packedUv) -
addVertex
- Specified by:
addVertex
in interfaceVertexConsumer
-
setColor
- Specified by:
setColor
in interfaceVertexConsumer
-
setColor
- Specified by:
setColor
in interfaceVertexConsumer
-
setUv
- Specified by:
setUv
in interfaceVertexConsumer
-
setUv1
- Specified by:
setUv1
in interfaceVertexConsumer
-
setOverlay
- Specified by:
setOverlay
in interfaceVertexConsumer
-
setUv2
- Specified by:
setUv2
in interfaceVertexConsumer
-
setLight
- Specified by:
setLight
in interfaceVertexConsumer
-
uvShort
-
setNormal
- Specified by:
setNormal
in interfaceVertexConsumer
-
normalIntValue
private static byte normalIntValue(float value) -
addVertex
public void addVertex(float x, float y, float z, int color, float u, float v, int packedOverlay, int packedLight, float normalX, float normalY, float normalZ) - Specified by:
addVertex
in interfaceVertexConsumer
-