Skip to content

Commit 22d4384

Browse files
committed
fix GRAD_TABLE name
1 parent bd80bb3 commit 22d4384

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/open_simplex_noise_2d.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const SQUISH: f64 = 0.366_025_403_784_439; // (sqrt(2 + 1) - 1) / 2
88

99
const NORMALIZING_SCALAR: f64 = 47.0;
1010

11-
const GRAD_TABLE_2D: [Vec2<f64>; 8] = [
11+
const GRAD_TABLE: [Vec2<f64>; 8] = [
1212
Vec2::new(5.0, 2.0),
1313
Vec2::new(2.0, 5.0),
1414
Vec2::new(-5.0, 2.0),
@@ -26,7 +26,7 @@ impl NoiseEvaluator<Vec2<f64>> for OpenSimplexNoise2D {
2626
const SQUISH_POINT: Vec2<f64> = Vec2::new(SQUISH, SQUISH);
2727

2828
fn extrapolate(grid: Vec2<f64>, delta: Vec2<f64>, perm: &PermTable) -> f64 {
29-
let point = GRAD_TABLE_2D[OpenSimplexNoise2D::get_grad_table_index(grid, perm)];
29+
let point = GRAD_TABLE[OpenSimplexNoise2D::get_grad_table_index(grid, perm)];
3030
point.x * delta.x + point.y * delta.y
3131
}
3232

src/open_simplex_noise_3d.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const SQUISH: f64 = 1.0 / 3.0; // (sqrt(3 + 1) - 1) / 3
88

99
const NORMALIZING_SCALAR: f64 = 103.0;
1010

11-
const GRAD_TABLE_2D: [Vec3<f64>; 24] = [
11+
const GRAD_TABLE: [Vec3<f64>; 24] = [
1212
Vec3::new(-11.0, 4.0, 4.0),
1313
Vec3::new(-4.0, 11.0, 4.0),
1414
Vec3::new(-4.0, 4.0, 11.0),
@@ -42,7 +42,7 @@ impl NoiseEvaluator<Vec3<f64>> for OpenSimplexNoise3D {
4242
const SQUISH_POINT: Vec3<f64> = Vec3::new(SQUISH, SQUISH, SQUISH);
4343

4444
fn extrapolate(grid: Vec3<f64>, delta: Vec3<f64>, perm: &PermTable) -> f64 {
45-
let point = GRAD_TABLE_2D[OpenSimplexNoise3D::get_grad_table_index(grid, perm)];
45+
let point = GRAD_TABLE[OpenSimplexNoise3D::get_grad_table_index(grid, perm)];
4646

4747
point.x * delta.x + point.y * delta.y + point.z * delta.z
4848
}
@@ -339,6 +339,6 @@ impl OpenSimplexNoise3D {
339339
fn get_grad_table_index(grid: Vec3<f64>, perm: &PermTable) -> usize {
340340
let index0 = ((perm[(grid.x as i64 & 0xFF) as usize] + grid.y as i64) & 0xFF) as usize;
341341
let index1 = ((perm[index0] + grid.z as i64) & 0xFF) as usize;
342-
perm[index1] as usize % GRAD_TABLE_2D.len()
342+
perm[index1] as usize % GRAD_TABLE.len()
343343
}
344344
}

0 commit comments

Comments
 (0)