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

@@ -1,8 +1,3 @@
#[inline(always)]
pub fn is_power_of_two(x: usize) -> bool {
(x & (x - 1)) == 0
}
#[inline(always)]
pub fn wrap(x: f32, max: f32) -> f32 {
x - max * ((x > max) as i32 as f32 - (x < 0.0_f32) as i32 as f32)