diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-25 16:41:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-25 16:41:58 +0400 |
commit | 53d32a0bd2ca038c8fc6f82fac0009395c3d2490 (patch) | |
tree | b024b98c37bd3f2ad1f0f803a2f7eb80b02dc1ce /source/blender/blenlib/intern/math_geom_inline.c | |
parent | e99a23fc6b33b5097eab44aac19c2a089ddebce6 (diff) |
style cleanup: conform to style guide - mostly operator whitespace changes
Diffstat (limited to 'source/blender/blenlib/intern/math_geom_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_geom_inline.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/blenlib/intern/math_geom_inline.c b/source/blender/blenlib/intern/math_geom_inline.c index 634e68d0ccf..0d4c797cefb 100644 --- a/source/blender/blenlib/intern/math_geom_inline.c +++ b/source/blender/blenlib/intern/math_geom_inline.c @@ -37,19 +37,19 @@ MINLINE void zero_sh(float r[9]) { - memset(r, 0, sizeof(float)*9); + memset(r, 0, sizeof(float) * 9); } MINLINE void copy_sh_sh(float r[9], const float a[9]) { - memcpy(r, a, sizeof(float)*9); + memcpy(r, a, sizeof(float) * 9); } MINLINE void mul_sh_fl(float r[9], const float f) { int i; - for (i=0; i<9; i++) + for (i = 0; i < 9; i++) r[i] *= f; } @@ -57,18 +57,18 @@ MINLINE void add_sh_shsh(float r[9], const float a[9], const float b[9]) { int i; - for (i=0; i<9; i++) - r[i]= a[i] + b[i]; + for (i = 0; i < 9; i++) + r[i] = a[i] + b[i]; } MINLINE float dot_shsh(float a[9], float b[9]) { - float r= 0.0f; + float r = 0.0f; int i; - for (i=0; i<9; i++) - r += a[i]*b[i]; - + for (i = 0; i < 9; i++) + r += a[i] * b[i]; + return r; } @@ -80,16 +80,16 @@ MINLINE float diffuse_shv3(float sh[9], const float v[3]) static const float c4 = 0.886227f, c5 = 0.247708f; float x, y, z, sum; - x= v[0]; - y= v[1]; - z= v[2]; + x = v[0]; + y = v[1]; + z = v[2]; - sum= c1*sh[8]*(x*x - y*y); - sum += c3*sh[6]*z*z; - sum += c4*sh[0]; - sum += -c5*sh[6]; - sum += 2.0f*c1*(sh[4]*x*y + sh[7]*x*z + sh[5]*y*z); - sum += 2.0f*c2*(sh[3]*x + sh[1]*y + sh[2]*z); + sum = c1 * sh[8] * (x * x - y * y); + sum += c3 * sh[6] * z * z; + sum += c4 * sh[0]; + sum += -c5 * sh[6]; + sum += 2.0f * c1 * (sh[4] * x * y + sh[7] * x * z + sh[5] * y * z); + sum += 2.0f * c2 * (sh[3] * x + sh[1] * y + sh[2] * z); return sum; } @@ -100,21 +100,21 @@ MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f) * "An Efficient Representation for Irradiance Environment Maps" */ float sh[9], x, y, z; - x= v[0]; - y= v[1]; - z= v[2]; - - sh[0]= 0.282095f; - - sh[1]= 0.488603f*y; - sh[2]= 0.488603f*z; - sh[3]= 0.488603f*x; - - sh[4]= 1.092548f*x*y; - sh[5]= 1.092548f*y*z; - sh[6]= 0.315392f*(3.0f*z*z - 1.0f); - sh[7]= 1.092548f*x*z; - sh[8]= 0.546274f*(x*x - y*y); + x = v[0]; + y = v[1]; + z = v[2]; + + sh[0] = 0.282095f; + + sh[1] = 0.488603f * y; + sh[2] = 0.488603f * z; + sh[3] = 0.488603f * x; + + sh[4] = 1.092548f * x * y; + sh[5] = 1.092548f * y * z; + sh[6] = 0.315392f * (3.0f * z * z - 1.0f); + sh[7] = 1.092548f * x * z; + sh[8] = 0.546274f * (x * x - y * y); mul_sh_fl(sh, f); copy_sh_sh(r, sh); |