@@ -8,7 +8,7 @@ const SQUISH: f64 = 1.0 / 3.0; // (sqrt(3 + 1) - 1) / 3
88
99const 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