Parallel agents movement.
This commit is contained in:
@@ -14,14 +14,10 @@ pub struct Grid {
|
||||
blur: Blur,
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn is_power_of_two(x: usize) -> bool {
|
||||
(x & (x - 1)) == 0
|
||||
}
|
||||
|
||||
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) {
|
||||
panic!("Grid dimensitions must be a power of two.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user