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.
 Only the renderer should implement or extend this interface.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intCount of integers in a conventional (un-modded) block or item quad.static final intCount of integers in a conventional (un-modded) block or item vertex.
- 
Method SummaryModifier and TypeMethodDescriptionintcolor(int vertexIndex) Retrieve vertex color in ARGB format (0xAARRGGBB).@Nullable org.joml.Vector3fcopyNormal(int vertexIndex, @Nullable org.joml.Vector3f target) Pass a non-null target to avoid allocation - will be returned with values.org.joml.Vector3fcopyPos(int vertexIndex, @Nullable org.joml.Vector3f target) Pass a non-null target to avoid allocation - will be returned with values.org.joml.Vector2fcopyUv(int vertexIndex, @Nullable org.joml.Vector2f target) Pass a non-null target to avoid allocation - will be returned with values.@Nullable DirectioncullFace()If non-null, quad should not be rendered in-world if the opposite face of a neighbor block occludes it.org.joml.Vector3fcNormal of the quad as implied by geometry.booleanhasNormal(int vertexIndex) If false, no vertex normal was provided.@NotNull DirectionEquivalent toBakedQuad.getFace().intlightmap(int vertexIndex) Minimum block brightness.material()Retrieves the material serialized with the quad.@Nullable DirectionfloatnormalX(int vertexIndex) Will returnFloat.NaNif normal not present.floatnormalY(int vertexIndex) Will returnFloat.NaNif normal not present.floatnormalZ(int vertexIndex) Will returnFloat.NaNif normal not present.floatposByIndex(int vertexIndex, int coordinateIndex) Convenience: access x, y, z by index 0-2.inttag()Retrieves the integer tag encoded with this quad viaMutableQuadView.tag(int).intRetrieves the quad tint index serialized with the quad.default BakedQuadtoBakedQuad(Sprite sprite) Generates a new BakedQuad instance with texture coordinates and colors from the given sprite.voidtoVanilla(int[] target, int targetIndex) Reads baked vertex data and outputs standardbaked quad vertex datain the given array and location.floatu(int vertexIndex) Retrieve horizontal texture coordinates.floatv(int vertexIndex) Retrieve vertical texture coordinates.floatx(int vertexIndex) Retrieve geometric position, x coordinate.floaty(int vertexIndex) Retrieve geometric position, y coordinate.floatz(int vertexIndex) Retrieve geometric position, z coordinate.
- 
Field Details- 
VANILLA_VERTEX_STRIDEstatic final int VANILLA_VERTEX_STRIDECount of integers in a conventional (un-modded) block or item vertex.
- 
VANILLA_QUAD_STRIDEstatic final int VANILLA_QUAD_STRIDECount of integers in a conventional (un-modded) block or item quad.
 
- 
- 
Method Details- 
xfloat x(int vertexIndex) Retrieve geometric position, x coordinate.
- 
yfloat y(int vertexIndex) Retrieve geometric position, y coordinate.
- 
zfloat z(int vertexIndex) Retrieve geometric position, z coordinate.
- 
posByIndexfloat posByIndex(int vertexIndex, int coordinateIndex) Convenience: access x, y, z by index 0-2.
- 
copyPosorg.joml.Vector3f copyPos(int vertexIndex, @Nullable @Nullable org.joml.Vector3f target) Pass a non-null target to avoid allocation - will be returned with values. Otherwise returns a new instance.
- 
colorint color(int vertexIndex) Retrieve vertex color in ARGB format (0xAARRGGBB).
- 
ufloat u(int vertexIndex) Retrieve horizontal texture coordinates.
- 
vfloat v(int vertexIndex) Retrieve vertical texture coordinates.
- 
copyUvorg.joml.Vector2f copyUv(int vertexIndex, @Nullable @Nullable org.joml.Vector2f target) Pass a non-null target to avoid allocation - will be returned with values. Otherwise returns a new instance.
- 
lightmapint lightmap(int vertexIndex) Minimum block brightness. Zero if not set.
- 
hasNormalboolean hasNormal(int vertexIndex) If false, no vertex normal was provided. Lighting should use face normal in that case.
- 
normalXfloat normalX(int vertexIndex) Will returnFloat.NaNif normal not present.
- 
normalYfloat normalY(int vertexIndex) Will returnFloat.NaNif normal not present.
- 
normalZfloat normalZ(int vertexIndex) Will returnFloat.NaNif normal not present.
- 
copyNormal@Nullable @Nullable org.joml.Vector3f copyNormal(int vertexIndex, @Nullable @Nullable org.joml.Vector3f target) Pass a non-null target to avoid allocation - will be returned with values. Otherwise returns a new instance. Returns null if normal not present.
- 
cullFaceIf non-null, quad should not be rendered in-world if the opposite face of a neighbor block occludes it.- See Also:
 
- 
lightFaceEquivalent toBakedQuad.getFace(). This is the face used for vanilla lighting calculations and will be the block face to which the quad is most closely aligned. Always the same as cull face for quads that are on a block face, but never null.
- 
nominalFace
- 
faceNormalorg.joml.Vector3fc faceNormal()Normal of the quad as implied by geometry. Will be invalid if quad vertices are not co-planar. Typically computed lazily on demand.Not typically needed by models. Exposed to enable standard lighting utility functions for use by renderers. 
- 
materialRenderMaterial material()Retrieves the material serialized with the quad.
- 
tintIndexint tintIndex()Retrieves the quad tint index serialized with the quad.
- 
tagint tag()Retrieves the integer tag encoded with this quad viaMutableQuadView.tag(int). Will return zero if no tag was set. For use by models.
- 
toVanillavoid toVanilla(int[] target, int targetIndex) Reads baked vertex data and outputs standardbaked quad vertex datain the given array and location.- Parameters:
- target- Target array for the baked quad data.
- targetIndex- Starting position in target array - array must have at least- VANILLA_QUAD_STRIDEelements available at this index.
 
- 
toBakedQuadGenerates a new BakedQuad instance with texture coordinates and colors from the given sprite.- Parameters:
- sprite-- QuadViewdoes not serialize sprites so the sprite must be provided by the caller.
- Returns:
- A new baked quad instance with the closest-available appearance supported by vanilla features. Will retain emissive light maps, for example, but the standard Minecraft renderer will not use them.
 
 
-