pub struct StaticIcosphere<T: IcosphereVertex> {
pub vertices: Vec<T>,
pub triangles: Vec<[u32; 3]>,
pub neighbors: HashMap<usize, HashSet<usize>>,
pub binning_depth: usize,
/* private fields */
}Expand description
A sphere-like shape constructed by subdividing a regular icosahedron and normalizing the resulting coordinates.
All vertices and triangles are constructed for the entire shape upon creation. This can take huge
amounts of memory at high subdivisions. If you want to construct the triangles and vertices on-the-fly
to save memory, use a SparseIcosphere.
Fields§
§vertices: Vec<T>The vertices may be in any order, don’t rely on the order of this list.
triangles: Vec<[u32; 3]>Starting from the triangles of the regular icosahedron, each subdivision splits these triangles
into groups of four. These four triangles are always contiguous and are indexed by the index
of the parent icosahedron. For example, given the index parent_triangle, the four child
triangles are located at parent_triangle..parent_triangle + 4.
When rendering, if chunks are necessary, treat these groups of triangles as chunks.
neighbors: HashMap<usize, HashSet<usize>>For each vertex, this contains the five or six neighbor vertices.
binning_depth: usizeNumber of subdivisions from the regular icosahedron
Implementations§
Source§impl<T: IcosphereVertex> StaticIcosphere<T>
impl<T: IcosphereVertex> StaticIcosphere<T>
Trait Implementations§
Source§impl<T: Clone + IcosphereVertex> Clone for StaticIcosphere<T>
impl<T: Clone + IcosphereVertex> Clone for StaticIcosphere<T>
Source§fn clone(&self) -> StaticIcosphere<T>
fn clone(&self) -> StaticIcosphere<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug + IcosphereVertex> Debug for StaticIcosphere<T>
impl<T: Debug + IcosphereVertex> Debug for StaticIcosphere<T>
Source§impl<T: IcosphereVertex> Icosphere<T> for StaticIcosphere<T>
impl<T: IcosphereVertex> Icosphere<T> for StaticIcosphere<T>
Source§fn subdivide_chunk(&mut self, _previous: &Self, _parent_index: usize) -> bool
fn subdivide_chunk(&mut self, _previous: &Self, _parent_index: usize) -> bool
Doesn’t do anything because static icospheres are already fully subdivided.