Struct lyon_tessellation::BuffersBuilder
source · pub struct BuffersBuilder<'l, OutputVertex: 'l, OutputIndex: 'l, Ctor> { /* private fields */ }
Expand description
A temporary view on a VertexBuffers
object which facilitate the population of vertex and index
data.
BuffersBuilders
record the vertex offset from when they are created so that algorithms using
them don’t need to worry about offsetting indices if some geometry was added beforehand. This
means that from the point of view of a BuffersBuilder
user, the first added vertex is at always
offset at the offset 0 and VertexBuilder
takes care of translating indices adequately.
Often, algorithms are built to generate vertex positions without knowledge of eventual other
vertex vertex. The VertexConstructor
does the translation from generic Input
to OutputVertex
.
If your logic generates the actual vertex type directly, you can use the SimpleBuffersBuilder
convenience typedef.
Implementations
sourceimpl<'l, OutputVertex: 'l, OutputIndex: 'l, Ctor> BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor>
impl<'l, OutputVertex: 'l, OutputIndex: 'l, Ctor> BuffersBuilder<'l, OutputVertex, OutputIndex, Ctor>
pub fn new(
buffers: &'l mut VertexBuffers<OutputVertex, OutputIndex>,
ctor: Ctor
) -> Self
pub fn with_vertex_offset(self, offset: u32) -> Self
sourcepub fn with_inverted_winding(self) -> InvertWinding<Self>
pub fn with_inverted_winding(self) -> InvertWinding<Self>
Consumes self and returns a builder with opposite triangle face winding.