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.