Interface QuadView
- All Known Subinterfaces:
MutableQuadView,QuadEmitter
public interface QuadView
Interface for reading quad data encoded in Meshes.
Enables models to do analysis, re-texturing or translation without knowing the
renderer's vertex formats and without retaining redundant information.
Unless otherwise stated, assume all properties persist through serialization into Meshes and have an
effect in both block and item contexts. If a property is described as transient, then its value will not persist
through serialization into a Mesh.
Only the renderer should implement or extend this interface.
-
Method Summary
Modifier and TypeMethodDescriptionatlas()intcolor(int vertexIndex) Gets the vertex color in ARGB format (0xAARRGGBB) of the given vertex.@Nullable org.joml.Vector3fcopyNormal(int vertexIndex, @Nullable org.joml.Vector3f target) Copies the normal vector of the given vertex to the given target, if the vertex has a normal.org.joml.Vector3fcopyPos(int vertexIndex, @Nullable org.joml.Vector3f target) Copies the geometric position of the given vertex to the given target.org.joml.Vector2fcopyUv(int vertexIndex, @Nullable org.joml.Vector2f target) Copies the texture coordinates of the given vertex to the given target.@Nullable net.minecraft.core.DirectioncullFace()booleanThis method is equivalent toBakedQuad.shade().booleanemissive()org.joml.Vector3fcGets the normal vector of this quad as implied by its vertex positions.@Nullable net.minecraft.client.renderer.item.ItemStackRenderState.FoilTypeglint()booleanhasNormal(int vertexIndex) Returns whether a normal vector is present for the given vertex.net.minecraft.core.DirectionGets the light face of this quad as implied by its face normal.intlightmap(int vertexIndex) Gets the minimum lightmap value of the given vertex.@Nullable net.minecraft.core.DirectionfloatnormalX(int vertexIndex) Gets the X coordinate of the normal vector of the given vertex.floatnormalY(int vertexIndex) Gets the Y coordinate of the normal vector of the given vertex.floatnormalZ(int vertexIndex) Gets the Z coordinate of the normal vector of the given vertex.floatposByIndex(int vertexIndex, int coordinateIndex) Gets the specified coordinate of the geometric position of the given vertex.@Nullable net.minecraft.client.renderer.chunk.ChunkSectionLayerinttag()intThis method is equivalent toBakedQuad.tintIndex().default net.minecraft.client.renderer.block.model.BakedQuadtoBakedQuad(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite) Creates a newBakedQuadwith an appearance as close as possible to this quad, as permitted by vanilla.floatu(int vertexIndex) Gets the horizontal texture coordinates of the given vertex.floatv(int vertexIndex) Gets the vertical texture coordinates of the given vertex.floatx(int vertexIndex) Gets the X coordinate of the geometric position of the given vertex.floaty(int vertexIndex) Gets the Y coordinate of the geometric position of the given vertex.floatz(int vertexIndex) Gets the Z coordinate of the geometric position of the given vertex.
-
Method Details
-
x
float x(int vertexIndex) Gets the X coordinate of the geometric position of the given vertex. -
y
float y(int vertexIndex) Gets the Y coordinate of the geometric position of the given vertex. -
z
float z(int vertexIndex) Gets the Z coordinate of the geometric position of the given vertex. -
posByIndex
float posByIndex(int vertexIndex, int coordinateIndex) Gets the specified coordinate of the geometric position of the given vertex. Index 0 is X, 1 is Y, and 2 is Z. -
copyPos
org.joml.Vector3f copyPos(int vertexIndex, @Nullable org.joml.Vector3f target) Copies the geometric position of the given vertex to the given target. If the target isnull, a newVector3fwill be allocated and returned. -
color
int color(int vertexIndex) Gets the vertex color in ARGB format (0xAARRGGBB) of the given vertex. -
u
float u(int vertexIndex) Gets the horizontal texture coordinates of the given vertex. -
v
float v(int vertexIndex) Gets the vertical texture coordinates of the given vertex. -
copyUv
org.joml.Vector2f copyUv(int vertexIndex, @Nullable org.joml.Vector2f target) Copies the texture coordinates of the given vertex to the given target. If the target isnull, a newVector2fwill be allocated and returned. -
lightmap
int lightmap(int vertexIndex) Gets the minimum lightmap value of the given vertex. -
hasNormal
boolean hasNormal(int vertexIndex) Returns whether a normal vector is present for the given vertex. If not, the vertex implicitly uses the face normal. -
normalX
float normalX(int vertexIndex) Gets the X coordinate of the normal vector of the given vertex. ReturnsFloat.NaNif the normal is not present. -
normalY
float normalY(int vertexIndex) Gets the Y coordinate of the normal vector of the given vertex. ReturnsFloat.NaNif the normal is not present. -
normalZ
float normalZ(int vertexIndex) Gets the Z coordinate of the normal vector of the given vertex. ReturnsFloat.NaNif the normal is not present. -
copyNormal
@Nullable org.joml.Vector3f copyNormal(int vertexIndex, @Nullable org.joml.Vector3f target) Copies the normal vector of the given vertex to the given target, if the vertex has a normal. Otherwise, returnsnull. If the target isnulland a normal exists, a newVector3fwill be allocated and returned. -
faceNormal
org.joml.Vector3fc faceNormal()Gets the normal vector of this quad as implied by its vertex positions. It will be invalid if the vertices are not co-planar. -
lightFace
net.minecraft.core.Direction lightFace()Gets the light face of this quad as implied by its face normal. It is equal to the axis-aligned direction closest to the face normal, and is nevernull.This method is equivalent to
BakedQuad.direction(). -
nominalFace
@Nullable net.minecraft.core.Direction nominalFace()- See Also:
-
cullFace
@Nullable net.minecraft.core.Direction cullFace()- See Also:
-
renderLayer
@Nullable net.minecraft.client.renderer.chunk.ChunkSectionLayer renderLayer()- See Also:
-
emissive
boolean emissive()- See Also:
-
diffuseShade
boolean diffuseShade()This method is equivalent toBakedQuad.shade().- See Also:
-
ambientOcclusion
TriState ambientOcclusion()- See Also:
-
glint
@Nullable net.minecraft.client.renderer.item.ItemStackRenderState.FoilType glint()- See Also:
-
shadeMode
ShadeMode shadeMode()- See Also:
-
atlas
QuadAtlas atlas()- See Also:
-
tintIndex
int tintIndex()This method is equivalent toBakedQuad.tintIndex().- See Also:
-
tag
int tag()- See Also:
-
toBakedQuad
default net.minecraft.client.renderer.block.model.BakedQuad toBakedQuad(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite) Creates a newBakedQuadwith an appearance as close as possible to this quad, as permitted by vanilla.- Parameters:
sprite- The sprite is not serialized so it must be provided by the caller. Retrieve it usingSpriteFinder.find(QuadView)if it is not already known.
-