diff options
Diffstat (limited to 'source/blender/blenlib/intern/math_vector_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index e625ac18685..17e2da3f1cb 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -633,6 +633,13 @@ MINLINE void negate_v3_short(short r[3]) r[2] = (short)-r[2]; } +MINLINE void invert_v2(float r[2]) +{ + BLI_assert(!ELEM(0.0f, r[0], r[1])); + r[0] = 1.0f / r[0]; + r[1] = 1.0f / r[1]; +} + MINLINE void abs_v2(float r[2]) { r[0] = fabsf(r[0]); |