bevy_feronia 0.8.2

Foliage/grass scattering tools and wind simulation shaders/materials that prioritize visual fidelity/artistic freedom, a declarative api and modularity.
Documentation
use crate::height_map::cpu_sampler::HeightMapCpuSampler;
use crate::prelude::Sampler;
use bevy_math::Vec3;

pub struct DefaultSampler;

impl Sampler for DefaultSampler {
    fn sample(&self, _world_pos: Vec3) -> f32 {
        0.
    }
}

impl<'a> Sampler for HeightMapSampler<'a> {
    fn sample(&self, world_pos: Vec3) -> f32 {
        match self {
            HeightMapSampler::Default(sampler) => sampler.sample(world_pos),
            HeightMapSampler::Cpu(sampler) => sampler.sample(world_pos),
        }
    }
}

pub enum HeightMapSampler<'a> {
    Default(DefaultSampler),
    Cpu(HeightMapCpuSampler<'a>),
}