Skip to main content

SectionGeometryContext

Trait SectionGeometryContext 

pub trait SectionGeometryContext {
    // Required methods
    fn level(&self) -> &dyn BlockAndTintGetter;
    fn add(&mut self, sprite: &str, quad: SectionQuad) -> bool;
    fn remaining(&self) -> u32;
}
Expand description

One section a SectionGeometry adds quads to. The section’s quads, its own blocks’ and every renderer’s together, share one budget: 262144 quads and 32 MiB of mesh data. All sections meshing at once share another, 128 MiB of added quads not yet in their meshes. A quad is checked against them before it is kept.

Required Methods§

fn level(&self) -> &dyn BlockAndTintGetter

Reads the section’s chunk and its eight neighbours.

fn add(&mut self, sprite: &str, quad: SectionQuad) -> bool

Adds quad, drawn with the block atlas sprite sprite (minecraft:block/stone, a mod’s mymod:block/glow). False when this renderer’s quads for the section are refused, and then none of them are drawn and every later add is false too: a quad past a budget, a corner or UV out of range or not a number, or a sprite the atlas lacks refuses them all.

fn remaining(&self) -> u32

How many more quads the section takes before its budget refuses one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§