diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:20:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:20:06 +0400 |
commit | 30a7c6d2813dac7492b845adcffc2c129f3f8ba1 (patch) | |
tree | 28f78c48ba9d8a51b59836996851ce35f12b4150 /source/blender/blenlib/intern/noise.c | |
parent | ed28a0296fc98411da11243f20698be7f7f645cf (diff) |
Merge a few small blenlib changes from the render25 branch:
* define for missing hypotf on msvc.
* svd_m4 and pseudoinverse_m4_m4 functions.
* small tweak to perlin noise, use static function instead of macro.
* BLI_linklist_find and BLI_linklist_insert_after functions.
* MALWAYS_INLINE define to force inlining.
Diffstat (limited to 'source/blender/blenlib/intern/noise.c')
-rw-r--r-- | source/blender/blenlib/intern/noise.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c index d6b8582ef26..141e5438bc9 100644 --- a/source/blender/blenlib/intern/noise.c +++ b/source/blender/blenlib/intern/noise.c @@ -199,8 +199,15 @@ float hashvectf[768]= { /* IMPROVED PERLIN NOISE */ /**************************/ -#define lerp(t, a, b) ((a)+(t)*((b)-(a))) -#define npfade(t) ((t)*(t)*(t)*((t)*((t)*6-15)+10)) +static float lerp(float t, float a, float b) +{ + return (a+t*(b-a)); +} + +static float npfade(float t) +{ + return (t*t*t*(t*(t*6.0f-15.0f)+10.0f)); +} static float grad(int hash, float x, float y, float z) { |