diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-09-06 01:01:50 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-09-06 01:01:50 +0400 |
commit | 8e0fe8bff72e2dc2926618577eaffdd3417a8304 (patch) | |
tree | 43b933c88cac451518dc68846c1119acacffca4f /source/blender/blenlib | |
parent | 6e9ff495eb082aeb49e6a1da23a7827d3fcd0fde (diff) |
Merged the particles-2010 branch with node improvements into trunk.
This branch adds mostly organizational improvements to the node system by renaming the node folders and files. A couple of internal features have been added too.
Detailed information can be found on the wiki page:
http://wiki.blender.org/index.php/User:Phonybone/Particles2010
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_matrix.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 18 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector.c | 8 |
4 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index d8719f399ae..18955c158c6 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -66,6 +66,9 @@ void swap_m4m4(float A[4][4], float B[4][4]); void add_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]); void add_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]); +void sub_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]); +void sub_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]); + void mul_m3_m3m3(float R[3][3], float A[3][3], float B[3][3]); void mul_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]); void mul_m4_m3m4(float R[4][4], float A[3][3], float B[4][4]); diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index c8b598a1e85..d30168c8657 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -124,6 +124,7 @@ void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const fl void interp_v3_v3v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4]); void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t); void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3]); +void interp_v4_v4v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4]); void mid_v3_v3v3(float r[3], const float a[3], const float b[3]); diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 3c79a77707a..e2f594376cb 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -451,6 +451,24 @@ void add_m4_m4m4(float m1[][4], float m2[][4], float m3[][4]) m1[i][j]= m2[i][j] + m3[i][j]; } +void sub_m3_m3m3(float m1[][3], float m2[][3], float m3[][3]) +{ + int i, j; + + for(i=0;i<3;i++) + for(j=0;j<3;j++) + m1[i][j]= m2[i][j] - m3[i][j]; +} + +void sub_m4_m4m4(float m1[][4], float m2[][4], float m3[][4]) +{ + int i, j; + + for(i=0;i<4;i++) + for(j=0;j<4;j++) + m1[i][j]= m2[i][j] - m3[i][j]; +} + int invert_m3(float m[3][3]) { float tmp[3][3]; diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c index 15d671e38d7..7dbceff46e4 100644 --- a/source/blender/blenlib/intern/math_vector.c +++ b/source/blender/blenlib/intern/math_vector.c @@ -96,6 +96,14 @@ void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const fl p[3] = v1[3]*w[0] + v2[3]*w[1] + v3[3]*w[2]; } +void interp_v4_v4v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4]) +{ + p[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3]; + p[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3]; + p[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3]; + p[3] = v1[3]*w[0] + v2[3]*w[1] + v3[3]*w[2] + v4[3]*w[3]; +} + void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3]) { v[0]= 0.5f*(v1[0] + v2[0]); |