QuadView

public interface QuadView

Interface for reading quad data encoded by MeshBuilder. Enables models to do analysis, re-texturing or translation without knowing the renderer's vertex formats and without retaining redundant information.

Only the renderer should implement or extend this interface.

Functions

colorIndex
Link copied to clipboard
abstract int colorIndex()
Retrieves the quad color index serialized with the quad.
copyNormal
Link copied to clipboard
@Nullable()
abstract Vec3f copyNormal(int vertexIndex, @Nullable() Vec3f target)
Pass a non-null target to avoid allocation - will be returned with values.Otherwise returns a new instance.
copyPos
Link copied to clipboard
abstract Vec3f copyPos(int vertexIndex, @Nullable() Vec3f target)
Pass a non-null target to avoid allocation - will be returned with values.Otherwise returns a new instance.
copyTo
Link copied to clipboard
abstract void copyTo(MutableQuadView target)
Extracts all quad properties except material to the given MutableQuadView instance.Must be used before calling {link QuadEmitter#emit()} on the target instance.Meant for re-texturing, analysis and static transformation use cases.
cullFace
Link copied to clipboard
@Nullable()
abstract Direction cullFace()
If non-null, quad should not be rendered in-world if theopposite face of a neighbor block occludes it.
faceNormal
Link copied to clipboard
abstract Vec3f faceNormal()
Normal of the quad as implied by geometry.
hasNormal
Link copied to clipboard
abstract boolean hasNormal(int vertexIndex)
If false, no vertex normal was provided.Lighting should use face normal in that case.
lightFace
Link copied to clipboard
@NotNull()
abstract Direction lightFace()
Equivalent to getFace.
lightmap
Link copied to clipboard
abstract int lightmap(int vertexIndex)
Minimum block brightness.
material
Link copied to clipboard
abstract RenderMaterial material()
Retrieves the material serialized with the quad.
nominalFace
Link copied to clipboard
abstract Direction nominalFace()
normalX
Link copied to clipboard
abstract float normalX(int vertexIndex)
Will return NaN if normal not present.
normalY
Link copied to clipboard
abstract float normalY(int vertexIndex)
Will return NaN if normal not present.
normalZ
Link copied to clipboard
abstract float normalZ(int vertexIndex)
Will return NaN if normal not present.
posByIndex
Link copied to clipboard
abstract float posByIndex(int vertexIndex, int coordinateIndex)
Convenience: access x, y, z by index 0-2.
spriteColor
Link copied to clipboard
abstract int spriteColor(int vertexIndex, int spriteIndex)
Retrieve vertex color.
spriteU
Link copied to clipboard
abstract float spriteU(int vertexIndex, int spriteIndex)
Retrieve horizontal sprite atlas coordinates.
spriteV
Link copied to clipboard
abstract float spriteV(int vertexIndex, int spriteIndex)
Retrieve vertical sprite atlas coordinates.
tag
Link copied to clipboard
abstract int tag()
Retrieves the integer tag encoded with this quad via tag.Will return zero if no tag was set.
toBakedQuad
Link copied to clipboard
BakedQuad toBakedQuad(int spriteIndex, Sprite sprite, boolean isItem)
Generates a new BakedQuad instance with texturecoordinates and colors from the given sprite.
toVanilla
Link copied to clipboard
abstract void toVanilla(int spriteIndex, Array<int> target, int targetIndex, boolean isItem)
Reads baked vertex data and outputs standard baked quadvertex data in the given array and location.
x
Link copied to clipboard
abstract float x(int vertexIndex)
Geometric position, x coordinate.
y
Link copied to clipboard
abstract float y(int vertexIndex)
Geometric position, y coordinate.
z
Link copied to clipboard
abstract float z(int vertexIndex)
Geometric position, z coordinate.

Inheritors

MutableQuadView
Link copied to clipboard

Sources

jvm source
Link copied to clipboard