pub struct Geometry { /* private fields */ }
Expand description

Generated geometry data used for instanced rendering, represented as triangles.

For example, you can define that a quad has 4 vertices, spanning 2 triangles (for use in e.g. crate::QuadIns), so you don’t have to manually create them every time you want to render a quad.

Implementations

Instantiates a new Geometry.

vertex_attributes correspond to “geometry” fields in the shader. Be sure to use #[repr(C)] in the structs you pass in. Structs can only contain fields of type f32/Vec2/Vec3/Vec4.

Anything that we can get an f32-slice ([f32]) from works here.

triangle_indices - the indices of vertex attributes by which to render each triangle. A triangle has 3 vertices, hence we group indices in sets of 3.

Trait Implementations

Returns the “default value” for a type. 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

Performs the conversion.

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.