pub struct Grass {Show 18 fields
pub count: i32,
pub width: f32,
pub depth: f32,
pub blade_height: f32,
pub height_variation: f32,
pub blade_width: f32,
pub lean: f32,
pub seed: i32,
pub base_color: [f32; 4],
pub tip_color: [f32; 4],
pub wind_strength: f32,
pub wind_speed: f32,
pub chunk_size: f32,
pub fade_start: f32,
pub fade_end: f32,
pub patchiness: f32,
pub round: bool,
pub flowers: f32,
/* private fields */
}Expand description
Seeded grass patch split into transient mesh chunks for frustum culling. Wind is animated by the grass shader; geometry is rebuilt when parameters change.
Fields§
§count: i32Blades in the whole patch.
width: f32Patch size in metres, centred on the entity.
depth: f32Patch depth in metres along the local Z axis.
blade_height: f32Mean blade height in metres.
height_variation: f32Relative randomized variation of blade height.
blade_width: f32Blade base width in metres.
lean: f32Resting lean of the blades.
seed: i32Deterministic patch seed; identical parameters produce identical blades.
base_color: [f32; 4]RGBA tint at the blade base.
tip_color: [f32; 4]RGBA tint at the blade tip.
wind_strength: f32Shader wind displacement multiplier.
wind_speed: f32Shader wind animation speed multiplier.
chunk_size: f32Chunk edge in metres: smaller chunks cull better, larger ones need fewer draw calls.
fade_start: f32Distance where blades start thinning out, and where the grass is gone.
fade_end: f32World-space distance where all grass blades have faded out.
patchiness: f320..1: patchy dry / lush colour variation across the meadow.
round: boolFill an ellipse inside width x depth instead of the whole rectangle (soft, thinning edge).
flowers: f32Share of blades that carry a small wild flower, 0..0.3.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Grass
impl<'de> Deserialize<'de> for Grass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Grass
impl RefUnwindSafe for Grass
impl Send for Grass
impl Sync for Grass
impl Unpin for Grass
impl UnsafeUnpin for Grass
impl UnwindSafe for Grass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSync for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.