Add trail deposition, diffusion and decay.

This commit is contained in:
mindv0rtex
2021-02-26 20:39:27 -05:00
parent cf35e041dd
commit 51f10723ed
4 changed files with 26 additions and 12 deletions

View File

@@ -17,8 +17,7 @@ pub struct Grid {
impl Grid {
/// Create a new grid filled with random floats in the [0.0..1.0) range.
pub fn new(width: usize, height: usize) -> Self {
use crate::util::is_power_of_two;
if !is_power_of_two(width) || !is_power_of_two(height) {
if !width.is_power_of_two() || !height.is_power_of_two() {
panic!("Grid dimensitions must be a power of two.");
}
let rng = rand::thread_rng();