diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 4 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index af8b52a7edf..7a39fc8b8ce 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -50,6 +50,10 @@ MINLINE void copy_v2_v2(float r[2], const float a[2]); MINLINE void copy_v3_v3(float r[3], const float a[3]); MINLINE void copy_v4_v4(float r[4], const float a[4]); +MINLINE void copy_v2_fl(float r[2], float f); +MINLINE void copy_v3_fl(float r[3], float f); +MINLINE void copy_v4_fl(float r[4], float f); + MINLINE void swap_v2_v2(float a[2], float b[2]); MINLINE void swap_v3_v3(float a[3], float b[3]); MINLINE void swap_v4_v4(float a[4], float b[4]); diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index 854494763af..12e11714a13 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -77,6 +77,27 @@ MINLINE void copy_v4_v4(float r[4], const float a[4]) r[3]= a[3]; } +MINLINE void copy_v2_fl(float r[2], float f) +{ + r[0]= f; + r[1]= f; +} + +MINLINE void copy_v3_fl(float r[3], float f) +{ + r[0]= f; + r[1]= f; + r[2]= f; +} + +MINLINE void copy_v4_fl(float r[4], float f) +{ + r[0]= f; + r[1]= f; + r[2]= f; + r[3]= f; +} + /* short */ MINLINE void copy_v2_v2_char(char r[2], const char a[2]) { |