[][src]Struct hexasphere::Hexasphere

pub struct Hexasphere<T> { /* fields omitted */ }

Hexagonally tiled sphere. Created with the new method.

Points are represented as the triangular subdivisions of the faces of an icosahedron, the dual of which creates a hexagonally tiled sphere with 12 pentagons. The number of subdivisions is exactly equal to the number of hexagons between adjacent pentagons.

Points are stored in normalized space, on the surface of a unit sphere. The initial points are spherically interpolated to preserve accuracy, and not distort due to projections such as linear interpolation and then normalization.

Implementations

impl<T> Hexasphere<T>[src]

pub fn new(subdivisions: usize, generator: impl FnMut(Vec3) -> T) -> Self[src]

Creates a hexagonally tiled sphere.

The number of hexagons between pentagons is subdivisions, and generator permits you to create a unique value for every point on the sphere.

pub fn raw_points(&self) -> &[Vec3][src]

pub fn get_indices(&self, triangle: usize, buffer: &mut Vec<u32>)[src]

Appends the indices for the triangle into buffer.

pub fn subdivisions(&self) -> usize[src]

pub fn raw_data(&self) -> &[T][src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Hexasphere<T> where
    T: RefUnwindSafe

impl<T> Send for Hexasphere<T> where
    T: Send

impl<T> Sync for Hexasphere<T> where
    T: Sync

impl<T> Unpin for Hexasphere<T> where
    T: Unpin

impl<T> UnwindSafe for Hexasphere<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.