Struct lyon::tessellation::geometry_builder::BuffersBuilder [−][src]
pub struct BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
IndexType: 'l,
VertexType: 'l, { /* fields omitted */ }
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 VertexBuilfer
takes care of translating indices adequately.
Often, algorithms are built to generate vertex positions without knowledge of eventual other
vertex attributes. The VertexConstructor
does the translation from generic Input
to VertexType
.
If your logic generates the actual vertex type directly, you can use the SimpleBuffersBuilder
convenience typedef.
Methods
impl<'l, VertexType, IndexType, Input, Ctor> BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
IndexType: 'l,
VertexType: 'l,
[src]
impl<'l, VertexType, IndexType, Input, Ctor> BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
IndexType: 'l,
VertexType: 'l,
pub fn new(
buffers: &'l mut VertexBuffers<VertexType, IndexType>,
ctor: Ctor
) -> BuffersBuilder<'l, VertexType, IndexType, Input, Ctor>
[src]
pub fn new(
buffers: &'l mut VertexBuffers<VertexType, IndexType>,
ctor: Ctor
) -> BuffersBuilder<'l, VertexType, IndexType, Input, Ctor>
pub fn buffers<'a, 'b>(&'b self) -> &'a VertexBuffers<VertexType, IndexType> where
'b: 'a,
[src]
pub fn buffers<'a, 'b>(&'b self) -> &'a VertexBuffers<VertexType, IndexType> where
'b: 'a,
Trait Implementations
impl<'l, VertexType, IndexType, InputVertex, Ctor> GeometryReceiver<InputVertex> for BuffersBuilder<'l, VertexType, IndexType, InputVertex, Ctor> where
Ctor: VertexConstructor<InputVertex, VertexType>,
IndexType: From<VertexId>,
InputVertex: Clone,
VertexType: 'l + Clone,
[src]
impl<'l, VertexType, IndexType, InputVertex, Ctor> GeometryReceiver<InputVertex> for BuffersBuilder<'l, VertexType, IndexType, InputVertex, Ctor> where
Ctor: VertexConstructor<InputVertex, VertexType>,
IndexType: From<VertexId>,
InputVertex: Clone,
VertexType: 'l + Clone,
fn set_geometry(&mut self, vertices: &[InputVertex], indices: &[u32])
[src]
fn set_geometry(&mut self, vertices: &[InputVertex], indices: &[u32])
impl<'l, VertexType, IndexType, Input, Ctor> GeometryBuilder<Input> for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: VertexConstructor<Input, VertexType>,
IndexType: Add<IndexType> + From<VertexId>,
VertexType: 'l + Clone,
[src]
impl<'l, VertexType, IndexType, Input, Ctor> GeometryBuilder<Input> for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: VertexConstructor<Input, VertexType>,
IndexType: Add<IndexType> + From<VertexId>,
VertexType: 'l + Clone,
fn begin_geometry(&mut self)
[src]
fn begin_geometry(&mut self)
Called at the beginning of a generation. Read more
fn end_geometry(&mut self) -> Count
[src]
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. Read more
fn add_vertex(&mut self, v: Input) -> VertexId
[src]
fn add_vertex(&mut self, v: Input) -> VertexId
Inserts a vertex, providing its position, and optionally a normal. Retuns a vertex id that is only valid between begin_geometry and end_geometry. Read more
fn add_triangle(&mut self, a: VertexId, b: VertexId, c: VertexId)
[src]
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. Read more
fn abort_geometry(&mut self)
[src]
fn abort_geometry(&mut self)
abort_geometry is called instead of end_geometry if an error occured while producing the geometry and we won't be able to finish. Read more
Auto Trait Implementations
impl<'l, VertexType, IndexType, Input, Ctor> Send for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: Send,
IndexType: Send,
Input: Send,
VertexType: Send,
impl<'l, VertexType, IndexType, Input, Ctor> Send for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: Send,
IndexType: Send,
Input: Send,
VertexType: Send,
impl<'l, VertexType, IndexType, Input, Ctor> Sync for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: Sync,
IndexType: Sync,
Input: Sync,
VertexType: Sync,
impl<'l, VertexType, IndexType, Input, Ctor> Sync for BuffersBuilder<'l, VertexType, IndexType, Input, Ctor> where
Ctor: Sync,
IndexType: Sync,
Input: Sync,
VertexType: Sync,