diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-15 14:28:32 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-04-15 14:28:32 +0400 |
commit | 9a85013692322f8a821b8228ad552f84d2a215e9 (patch) | |
tree | 666bb54fa093429d65b6b0322e8058c03f5fe223 /source/blender/blenlib/intern/math_vector_inline.c | |
parent | 2b018673509fe7a38a6332fae00bd605335bd286 (diff) |
Merge various small changes from render branch:
* Division by zero fix for TNT SVD code.
* Sound fix, in case ffmpeg decode fails, don't use the samples.
* Fix for incorrect bounds of transformed objects in new raytracing code.
* Gave memory arena's a name used for allocations for easier memory
usage debugging.
* Dupligroup no_draw option was using layers but not restrict view/render
setting. (not a bugfix exactly but would do display list context switching
while drawing for no reason).
* Fix objects instanced on hair particles not giving consistent results
when the object is transformed.
* New math functions: madd_v4_v4fl, len_squared_v3v3, interp_v4_v4v4v4,
mul_v4_m4v4, SH and form factor functions, box_minmax_bounds_m4.
* mul_m4_m4m4 and mul_m3_m3m3 now accept the same pointers for multiple
arguments.
* endjob callback for WM jobs system.
* Geometry node uv/color layer now has search list/autocomplete.
* Various small buildsystem tweaks, not strictly needed yet in trunk.
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index f82daaa8af6..974832051af 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -188,6 +188,12 @@ MINLINE void mul_v3_v3(float r[3], const float a[3]) r[2] *= a[2]; } +MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f) +{ + r[0] += a[0]*f; + r[1] += a[1]*f; +} + MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f) { r[0] += a[0]*f; @@ -222,6 +228,14 @@ MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], cons r[2] = a[2] + b[2]*c[2]; } +MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f) +{ + r[0] += a[0]*f; + r[1] += a[1]*f; + r[2] += a[2]*f; + r[3] += a[3]*f; +} + MINLINE void mul_v3_v3v3(float *v, const float *v1, const float *v2) { v[0] = v1[0] * v2[0]; @@ -305,6 +319,14 @@ MINLINE float len_v3v3(const float a[3], const float b[3]) return len_v3(d); } +MINLINE float len_squared_v3v3(const float a[3], const float b[3]) +{ + float d[3]; + + sub_v3_v3v3(d, b, a); + return dot_v3v3(d, d); +} + MINLINE float normalize_v2_v2(float r[2], const float a[2]) { float d= dot_v2v2(a, a); |