Struct magrathea::planet::Planet[][src]

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

A Procedural Planet definition

Fields

seed: u64

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

max_chaos: f32

Controls how "busy" the surface is -- a larger amount of chaos means a much bumpier surface

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 new_from_iter<I: IntoIterator<Item = ElevationColor<Kind>>>(
    seed: u64,
    origin: Point2D<f32, Kilometers>,
    radius: Length<f32, Kilometers>,
    colors: I
) -> Self where
    Kind: SurfaceDefinition
[src]

pub fn new_from_iter_with_chaos<I: IntoIterator<Item = ElevationColor<Kind>>>(
    seed: u64,
    origin: Point2D<f32, Kilometers>,
    radius: Length<f32, Kilometers>,
    colors: I,
    max_chaos: f32
) -> Self
[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

Trait Implementations

impl<Kind: Debug> Debug for Planet<Kind>[src]

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
    T: Component + Float,
    D: AdaptFrom<S, Swp, Dwp, T>,
    Swp: WhitePoint,
    Dwp: WhitePoint
[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> Pointable for T

type Init = T

The type for initializers.

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>,