Skip to main content

BladeType

Struct BladeType 

Source
pub struct BladeType {
    pub root_color: [f32; 3],
    pub tip_color: [f32; 3],
    pub height: f32,
    pub half_width: f32,
    pub height_spread: f32,
    pub width_spread: f32,
    pub look: BladeLook,
    pub style: BladeStyle,
    pub shape: BladeShape,
    pub clumping: Clumping,
}
Expand description

One row of the blade table — decision 3’s “one blade description”, drawn as its BladeType::look says.

Fields§

§root_color: [f32; 3]

The colour at the blade’s root. Decision 4’s root-occlusion lever: a darker root is what makes a field read as having depth.

§tip_color: [f32; 3]

The colour at its tip.

§height: f32

The tallest a blade of this row stands, in metres.

§half_width: f32

The widest half a card of this row is, in metres.

§height_spread: f32

The fraction of BladeType::height a blade may lose to its own hash, in 0..1.

§width_spread: f32

The same for BladeType::half_width.

A shell strand’s root is this half-width too, bounded by half a placement cell — see grass.slang’s grass_strand_reach.

§look: BladeLook

The geometry the row is drawn with.

§style: BladeStyle

Decision 4’s levers.

§shape: BladeShape

A mesh blade’s shape, read only where BladeType::look is BladeLook::Blades.

§clumping: Clumping

Decision 2’s clumping, for every look.

Implementations§

Source§

impl BladeType

Source

pub fn row(&self) -> GrassBlade

The row as the shader reads it.

Trait Implementations§

Source§

impl Clone for BladeType

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for BladeType

Source§

impl Debug for BladeType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for BladeType

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for BladeType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.