Struct magrathea::planet::Planet [−][src]
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]
Kind: Clone + Hash + Eq,
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]
seed: u64,
origin: Point2D<f32, Kilometers>,
radius: Length<f32, Kilometers>,
colors: I
) -> Self where
Kind: SurfaceDefinition,
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]
seed: u64,
origin: Point2D<f32, Kilometers>,
radius: Length<f32, Kilometers>,
colors: I,
max_chaos: f32
) -> Self
pub fn generate(
&self,
pixels: u32,
sun: &Option<Light>
) -> GeneratedPlanet<Kind>
[src]
&self,
pixels: u32,
sun: &Option<Light>
) -> GeneratedPlanet<Kind>
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]
&mut self,
angle: Angle<f32>,
distance: Length<f32, Kilometers>
)
Convience method to calculate the origin of a planet if it orbited in an exact circle at distance
Trait Implementations
Auto Trait Implementations
impl<Kind> RefUnwindSafe for Planet<Kind> where
Kind: RefUnwindSafe,
Kind: RefUnwindSafe,
impl<Kind> Send for Planet<Kind> where
Kind: Send,
Kind: Send,
impl<Kind> Sync for Planet<Kind> where
Kind: Sync,
Kind: Sync,
impl<Kind> Unpin for Planet<Kind> where
Kind: Unpin,
Kind: Unpin,
impl<Kind> UnwindSafe for Planet<Kind> where
Kind: UnwindSafe,
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]
T: Component + Float,
D: AdaptFrom<S, Swp, Dwp, T>,
Swp: WhitePoint,
Dwp: WhitePoint,
pub fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
pub fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
pub fn convert_into(self) -> U
[src]
pub fn convert_unclamped_into(self) -> U
[src]
pub fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,