Struct softrender::mesh::Mesh
[−]
[src]
pub struct Mesh<V> { pub indices: Vec<u32>, pub vertices: Vec<Vertex<V>>, }
Mesh structure with indexed vertices.
Fields
indices: Vec<u32>
Vertex indices
If you are unfamiliar with vertex indices, it's a way of re-using vertices for multiple primitives.
For example (in 2D), for a rectangle made of two triangles, you would define the four points for each corner vertex:
vertex #: name = (x, y)
0: bottom_left = (0.0, 1.0)
1: top_left = (0.0, 1.0)
2: bottom_right = (1.0, 0.0)
3: top_right = (1.0, 1.0)
then you'd have your index list be something like:
[0, 1, 2, // bottom half triangle
1, 3, 2] // top half triangle
Note that both of those triangles go in a clockwise direction from vertex to vertex.
vertices: Vec<Vertex<V>>
Vertices with their vertex data
Trait Implementations
impl<V: Clone> Clone for Mesh<V>
[src]
fn clone(&self) -> Mesh<V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more