[][src]Struct magrathea::Planet

pub struct Planet<Kind> {
    pub seed: Uuid,
    pub origin: Point2D<f32, Kilometers>,
    pub radius: Length<f32, Kilometers>,
    pub colors: SortedVec<ElevationColor<Kind>>,
}

A Procedural Planet definition

Fields

seed: Uuid

The unique value that is used to seed the random number generator

origin: Point2D<f32, Kilometers>

The origin of the planet relative to the star it orbits

radius: Length<f32, Kilometers>

The radius of the planet

colors: SortedVec<ElevationColor<Kind>>

The ElevationColors used to generate the terrain

Implementations

impl<Kind> Planet<Kind> where
    Kind: Clone + Hash + Eq
[src]

pub fn generate(
    &self,
    pixels: u32,
    sun: &Option<Light>
) -> GeneratedPlanet<Kind>
[src]

Generates an image of pixels wide, and pixels tall. If a light is provided a shadow is simulated, and the colors are mixed with the light's color

pub fn set_origin_by_angle(
    &mut self,
    angle: Angle<f32>,
    distance: Length<f32, Kilometers>
)
[src]

Convience method to calculate the origin of a planet if it orbited in an exact circle at distance

Auto Trait Implementations

impl<Kind> RefUnwindSafe for Planet<Kind> where
    Kind: RefUnwindSafe

impl<Kind> Send for Planet<Kind> where
    Kind: Send

impl<Kind> Sync for Planet<Kind> where
    Kind: Sync

impl<Kind> Unpin for Planet<Kind> where
    Kind: Unpin

impl<Kind> UnwindSafe for Planet<Kind> where
    Kind: UnwindSafe

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,