Struct genmesh::Neighbors [−][src]
pub struct Neighbors<T> { pub vertices: Vec<T>, pub polygons: Vec<Triangle<usize>>, // some fields omitted }
Neighbors search accelerating structure.
Fields
vertices: Vec<T>
Mesh vertices.
polygons: Vec<Triangle<usize>>
Mesh polygons.
Methods
impl<T> Neighbors<T>
[src]
impl<T> Neighbors<T>
pub fn new(vertices: Vec<T>, polygons: Vec<Triangle<usize>>) -> Self
[src]
pub fn new(vertices: Vec<T>, polygons: Vec<Triangle<usize>>) -> Self
Build a Neighbors search based on the supplied vertices and supplied triangle list.
pub fn split(self) -> (Vec<T>, Vec<Triangle<usize>>)
[src]
pub fn split(self) -> (Vec<T>, Vec<Triangle<usize>>)
return the vector and triangle list used to create the Neighbors
pub fn vertex_neighbors(&self, t: &usize) -> Option<&[usize]>
[src]
pub fn vertex_neighbors(&self, t: &usize) -> Option<&[usize]>
looks up the index of every polygon that contains vertex t, this can be used to calculate new faces
pub fn polygon_neighbors(&self, i: usize) -> Option<HashSet<usize>>
[src]
pub fn polygon_neighbors(&self, i: usize) -> Option<HashSet<usize>>
looks up the index of every polygon that is a neighbor of polygon at index i. This can be used to prep data for a Geometry shader (eg trinagle_adjacency)
pub fn normal_for_face<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
[src]
pub fn normal_for_face<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
Calculate the normal for face. This is a flat
shading
You must supply a function that can be used to lookup The position which is needed to calculate the normal
pub fn normal_for_vertex<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
[src]
pub fn normal_for_vertex<F>(&self, i: usize, f: F) -> Normal where
F: FnMut(&T) -> Normal,
Calculate the normal for an vertex based on the average
of it's Neighbors this is a smooth
shading
You must supply a function that can be used to lookup The position which is needed to calculate the normal