diff options
| author | timb <opuscule@gmail.com> | 2014-01-14 23:33:59 -0800 |
|---|---|---|
| committer | timb <opuscule@gmail.com> | 2014-01-14 23:33:59 -0800 |
| commit | 282657a4beb7c78c4420c6b8268d8d929fe6a670 (patch) | |
| tree | 301ef482e35bec558339287942f9334ef9b5e8c1 /js | |
| parent | 5242f387995b6251ff1bf7902b3ac6428f381fb0 (diff) | |
reorder smoothstep args, add julestep fn back
Diffstat (limited to 'js')
| -rw-r--r-- | js/util.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -61,9 +61,13 @@ function step(a, b){ // ^^ bool -> int } +function julestep (a,b,n) { + return clamp((n - a) / (b - a), 0.0, 1.0); +} + // hermite curve apparently -function smoothstep(n,a,b){ - var t = clamp((n - a) / (b - a), 0.0, 1.0); +function smoothstep(min,max,n){ + var t = clamp((n - min) / (max - min), 0.0, 1.0); return t * t * (3.0 - 2.0 * t) } |
