nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e70c9a
)
lib/noise: fix the expected amplitude of the pseudo random value to be in [-1.0 ...
author
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 2 Jul 2015 04:57:04 +0000
(
00:57
-0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 17 Jul 2015 14:28:33 +0000
(10:28 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/noise.nit
patch
|
blob
|
history
diff --git
a/lib/noise.nit
b/lib/noise.nit
index
7f26401
..
71dfdfc
100644
(file)
--- a/
lib/noise.nit
+++ b/
lib/noise.nit
@@
-301,7
+301,8
@@
class InterpolatedNoise
var ix1 = sx.lerp(n0, n1)
var val = sy.lerp(ix0, ix1)
- # Return value in [min...max] from val in [-0.5...0.5]
+ # Return value in [min...max] from val in [-1.0...1.0]
+ val /= 2.0
val += 0.5
return val.lerp(min, max)
end