Trait lyon_tessellation::geometry_builder::GeometryBuilder [] [src]

pub trait GeometryBuilder<Input> {
    fn begin_geometry(&mut self);
fn end_geometry(&mut self) -> Count;
fn add_vertex(&mut self, vertex: Input) -> VertexId;
fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId);
fn abort_geometry(&mut self); }

An interface separating tessellators and other geometry generation algorithms from the actual vertex construction.

See the geometry_builder module documentation for more detailed explanation.

Required Methods

Called at the beginning of a generation.

end_geometry must be called before begin_geometry is called again.

Called at the end of a generation. Returns the number of vertices and indices added since the last time begin_geometry was called.

Inserts a vertex, providing its position, and optionally a normal. Retuns a vertex id that is only valid between begin_geometry and end_geometry.

This method can only be called between begin_geometry and end_geometry.

Insert a triangle made of vertices that were added after the last call to begin_geometry.

This method can only be called between begin_geometry and end_geometry.

abort_geometry is called instead of end_geometry if an error occured while producing the geometry and we won't be able to finish.

The implementation is expected to discard the geometry that was generated since the last time begin_geometry was called, and to remain in a usable state.

Implementors