Struct bevy_retrograde::core::luminance::tess::TessBuilder[]

pub struct TessBuilder<'a, B, V, I = (), W = (), S = Interleaved> where
    V: TessVertexData<S>,
    S: ?Sized,
    W: TessVertexData<S>,
    B: ?Sized
{ /* fields omitted */ }
Expand description

Tess builder object.

This type allows to create Tess via a builder pattern. You have several flavors of possible vertex storage situations, as well as data encoding, described below.

Vertex storage

Interleaved

You can pass around interleaved vertices and indices. Those are encoded in Vec<T>. You typically want to use this when you already have the vertices and/or indices allocated somewhere, as the interface will use the input vector as a source of truth for lengths.

Deinterleaved

This is the same as interleaved data in terms of interface, but the T type is interpreted a bit differently. Here, the encoding is (Vec<Field0>, Vec<Field1>, …), where Field0, Field1 etc. are all the ordered fieds in T.

That representation allows field-based operation later on Tess, while it would be impossible with the interleaved version (you would need to get all the fields at once, since you would work onT directly and each of its fields).

Data encoding

  • Vectors: you can pass vectors as input data for both vertices and indices. Those will be interpreted differently based on the vertex storage you chose for vertices, and the normal way for indices.
  • Buffers: you can pass Buffer objects, too. Those are more flexible than vectors as you can use all of the Buffer API before sending them to the builder.
  • Disabled: disabling means that no data will be passed to the GPU. You can disable independently vertex data and/or index data.

Parametricity

  • B is the backend type
  • V is the vertex type.
  • S is the storage type.

Implementations

Set the Mode to connect vertices.

Calling that function twice replaces the previously set value.

Set the default number of vertices to render.

Calling that function twice replaces the previously set value.

Set the default number of instances to render.

Calling that function twice replaces the previously set value.

Set the primitive restart index.

Calling that function twice replaces the previously set value.

Create a new default TessBuilder.

Notes

Feel free to use the GraphicsContext::new_tess method for a simpler method.

Add indices to be bundled in the Tess.

Every time you call that function, the set of indices is replaced by the one you provided. The type of expected indices is ruled by the II type variable you chose.

Add vertices to be bundled in the Tess.

Every time you call that function, the set of vertices is replaced by the one you provided.

Add instances to be bundled in the Tess.

Every time you call that function, the set of instances is replaced by the one you provided.

Add vertices to be bundled in the Tess.

Every time you call that function, the set of vertices is replaced by the one you provided.

Add instances to be bundled in the Tess.

Every time you call that function, the set of instances is replaced by the one you provided.

Build a Tess if the TessBuilder has enough data and is in a valid state. What is needed is backend-dependent but most of the time, you will want to:

  • Set a Mode.
  • Give vertex data and optionally indices, or give none of them but only a number of vertices (attributeless objects).
  • If you provide vertex data by submitting several sets with TessBuilder::set_attributes and/or TessBuilder::set_instances, do not forget that you must submit sets with the same size. Otherwise, the GPU will not know what values use for missing attributes in vertices.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.