MutableQuadView

public interface MutableQuadView implements QuadView

A mutable QuadView instance. The base interface for QuadEmitter and for dynamic renders/mesh transforms.

Instances of MutableQuadView will practically always be threadlocal and/or reused - do not retain references.

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.
abstract MutableQuadView colorIndex(int colorIndex)
Value functions identically to getColorIndex and isused by renderer / model builder in same way.
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.
@Nullable()
abstract MutableQuadView cullFace(@Nullable() Direction face)
If non-null, quad is coplanar with a block face which, if known, simplifiesor shortcuts geometric analysis that might otherwise be needed.Set to null if quad is not coplanar or if this is not known.Also controls face culling during block rendering.
faceNormal
Link copied to clipboard
abstract Vec3f faceNormal()
Normal of the quad as implied by geometry.
fromVanilla
Link copied to clipboard
abstract MutableQuadView fromVanilla(Array<int> quadData, int startIndex, boolean isItem)
Enables bulk vertex data transfer using the standard Minecraft vertex formats.This method should be performant whenever caller's vertex representation makes it feasible.
abstract MutableQuadView fromVanilla(BakedQuad quad, RenderMaterial material, Direction cullFace)
Enables bulk vertex data transfer using the standard Minecraft vertex formats.This method should be performant whenever caller's vertex representation makes it feasible.
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.
abstract MutableQuadView lightmap(int vertexIndex, int lightmap)
Accept vanilla lightmap values.
MutableQuadView lightmap(int b0, int b1, int b2, int b3)
Convenience: set lightmap for all vertices at once.
material
Link copied to clipboard
abstract RenderMaterial material()
Retrieves the material serialized with the quad.
abstract MutableQuadView material(RenderMaterial material)
Assigns a different material to this quad.
nominalFace
Link copied to clipboard
abstract Direction nominalFace()
@Nullable()
abstract MutableQuadView nominalFace(Direction face)
Provides a hint to renderer about the facing of this quad.
normal
Link copied to clipboard
MutableQuadView normal(int vertexIndex, Vec3f vec)
Same as normal but accepts vector type.
abstract MutableQuadView normal(int vertexIndex, float x, float y, float z)
Adds a vertex normal.
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.
pos
Link copied to clipboard
MutableQuadView pos(int vertexIndex, Vec3f vec)
Same as pos but accepts vector type.
abstract MutableQuadView pos(int vertexIndex, float x, float y, float z)
Sets the geometric vertex position for the given vertex,relative to block origin.
posByIndex
Link copied to clipboard
abstract float posByIndex(int vertexIndex, int coordinateIndex)
Convenience: access x, y, z by index 0-2.
sprite
Link copied to clipboard
MutableQuadView sprite(int vertexIndex, int spriteIndex, Vec2f uv)
Set sprite atlas coordinates.
abstract MutableQuadView sprite(int vertexIndex, int spriteIndex, float u, float v)
Set sprite atlas coordinates.
spriteBake
Link copied to clipboard
abstract MutableQuadView spriteBake(int spriteIndex, Sprite sprite, int bakeFlags)
Assigns sprite atlas u,v coordinates to this quad for the given sprite.Can handle UV locking, rotation, interpolation, etc.
spriteColor
Link copied to clipboard
abstract int spriteColor(int vertexIndex, int spriteIndex)
Retrieve vertex color.
abstract MutableQuadView spriteColor(int vertexIndex, int spriteIndex, int color)
Set sprite color.
MutableQuadView spriteColor(int spriteIndex, int c0, int c1, int c2, int c3)
Convenience: set sprite color for all vertices at once.
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.
abstract MutableQuadView tag(int tag)
Encodes an integer tag with this quad that can later be retrieved via tag.
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

QuadEmitter
Link copied to clipboard

Sources

jvm source
Link copied to clipboard