[−][src]Trait lyon_tessellation::GeometryBuilder
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
fn begin_geometry(&mut self)
Called at the beginning of a generation.
end_geometry must be called before begin_geometry is called again.
fn end_geometry(&mut self) -> Count
Called at the end of a generation. Returns the number of vertices and indices added since the last time begin_geometry was called.
fn add_vertex(
&mut self,
vertex: Input
) -> Result<VertexId, GeometryBuilderError>
&mut self,
vertex: Input
) -> Result<VertexId, GeometryBuilderError>
Inserts a vertex, providing its position, and optionally a normal. Returns 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.
fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId)
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.
fn abort_geometry(&mut self)
abort_geometry is called instead of end_geometry if an error occurred 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
impl<'l, VertexType, IndexType, Input, Ctor> GeometryBuilder<Input> for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
VertexType: 'l + Clone,
IndexType: Add + From<VertexId> + MaxIndex,
Ctor: VertexConstructor<Input, VertexType>,
[src]
VertexType: 'l + Clone,
IndexType: Add + From<VertexId> + MaxIndex,
Ctor: VertexConstructor<Input, VertexType>,