Interface MeshView

All Known Subinterfaces:
Mesh, MutableMesh

public interface MeshView
A bundle of quads encoded by the renderer. It may be mutable or immutable.

Meshes are similar in purpose to List<BakedQuad> instances passed around in vanilla pipelines, but allow the renderer to optimize their format for performance and memory allocation.

All declared methods in this interface are not thread-safe and must not be used concurrently. Subclasses may override this contract.

Only the renderer should implement or extend this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    forEach(Consumer<? super QuadView> action)
    Access all quads encoded in this mesh.
    void
    Outputs all quads in this mesh to the given quad emitter.
    @org.jetbrains.annotations.Range(from=0L, to=2147483647L) int
    Returns the number of quads encoded in this mesh.
  • Method Details

    • size

      @org.jetbrains.annotations.Range(from=0L, to=2147483647L) int size()
      Returns the number of quads encoded in this mesh.
    • forEach

      void forEach(Consumer<? super QuadView> action)
      Access all quads encoded in this mesh. The quad instance sent to the consumer should never be retained outside the current call to the consumer.

      Nesting calls to this method on the same mesh is allowed.

    • outputTo

      void outputTo(QuadEmitter emitter)
      Outputs all quads in this mesh to the given quad emitter.