@@ -15,7 +15,7 @@ struct CellNoise2D:Noise
15
15
}
16
16
17
17
private
18
- func distance ( from sample_point: Math . DoubleV2 , generating_point: Math . IntV2 ) -> Double
18
+ func distance2 ( from sample_point: Math . DoubleV2 , generating_point: Math . IntV2 ) -> Double
19
19
{
20
20
let hash : Int = self . permutation_table. hash ( generating_point)
21
21
// hash is within 0 ... 255, take it to 0 ... 0.5
@@ -80,14 +80,14 @@ struct CellNoise2D:Noise
80
80
let nearpoint_disp : Math . DoubleV2 = ( abs ( sample_rel. x - Double( ( quadrant. a + 1 ) >> 1 ) ) ,
81
81
abs ( sample_rel. y - Double( ( quadrant. b + 1 ) >> 1 ) ) )
82
82
83
- var r2 : Double = self . distance ( from: sample, generating_point: near)
83
+ var r2 : Double = self . distance2 ( from: sample, generating_point: near)
84
84
85
85
@inline ( __always)
86
86
func _inspect( generating_point: Math . IntV2 , dx: Double = 0 , dy: Double = 0 )
87
87
{
88
88
if dx*dx + dy*dy < r2
89
89
{
90
- r2 = min ( r2, self . distance ( from: sample, generating_point: generating_point) )
90
+ r2 = min ( r2, self . distance2 ( from: sample, generating_point: generating_point) )
91
91
}
92
92
}
93
93
@@ -192,7 +192,7 @@ struct CellNoise3D:Noise
192
192
}
193
193
194
194
private
195
- func distance ( from sample_point: Math . DoubleV3 , generating_point: Math . IntV3 ) -> Double
195
+ func distance2 ( from sample_point: Math . DoubleV3 , generating_point: Math . IntV3 ) -> Double
196
196
{
197
197
let hash : Int = self . permutation_table. hash ( generating_point)
198
198
// hash is within 0 ... 255, take it to 0 ... 0.5
@@ -248,7 +248,7 @@ struct CellNoise3D:Noise
248
248
abs ( sample_rel. y - Double( ( quadrant. b + 1 ) >> 1 ) ) ,
249
249
abs ( sample_rel. z - Double( ( quadrant. c + 1 ) >> 1 ) ) )
250
250
251
- var r2 : Double = self . distance ( from: sample, generating_point: near)
251
+ var r2 : Double = self . distance2 ( from: sample, generating_point: near)
252
252
253
253
@inline ( __always)
254
254
func _inspect_cell( offset: Math . IntV3 )
@@ -286,7 +286,7 @@ struct CellNoise3D:Noise
286
286
let generating_point : Math . IntV3 = ( near. a + quadrant. a*offset. a,
287
287
near. b + quadrant. b*offset. b,
288
288
near. c + quadrant. c*offset. c)
289
- r2 = min ( r2, self . distance ( from: sample, generating_point: generating_point) )
289
+ r2 = min ( r2, self . distance2 ( from: sample, generating_point: generating_point) )
290
290
}
291
291
292
292
// check each cell group, exiting early if we are guaranteed to have found
0 commit comments