diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-09-29 18:54:13 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-10-01 16:14:46 +0300 |
commit | a5101de6a95647d19821bde9f8d68776ce8881fa (patch) | |
tree | 54d2687d2de935a767115447dc766c248a458630 | |
parent | e38a0b3748683a35601c256053f716ad8b57002f (diff) |
BLI: Add mul_v2_v2v2 function
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 0df407b37df..9e7c9a2db38 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -120,6 +120,7 @@ MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f); MINLINE void mul_v3_fl(float r[3], float f); MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f); MINLINE void mul_v2_v2(float r[2], const float a[2]); +MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2]); MINLINE void mul_v3_v3(float r[3], const float a[3]); MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]); MINLINE void mul_v4_fl(float r[4], float f); diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 297fa9479da..fcab001631e 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -615,6 +615,12 @@ MINLINE void mul_v3_v3v3(float r[3], const float v1[3], const float v2[3]) r[2] = v1[2] * v2[2]; } +MINLINE void mul_v2_v2v2(float r[2], const float a[2], const float b[2]) +{ + r[0] = a[0] * b[0]; + r[1] = a[1] * b[1]; +} + MINLINE void negate_v2(float r[2]) { r[0] = -r[0]; |