[Bf-blender-cvs] [5aa0c14] epic-navigation: New math function: negate_v2_int()

Dalai Felinto noreply at git.blender.org
Fri Oct 31 03:36:56 CET 2014


Commit: 5aa0c1435bdb33966d0ea25d918a803cb6525167
Author: Dalai Felinto
Date:   Fri Oct 31 00:16:06 2014 -0200
Branches: epic-navigation
https://developer.blender.org/rB5aa0c1435bdb33966d0ea25d918a803cb6525167

New math function: negate_v2_int()

===================================================================

M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/blenlib/intern/math_vector_inline.c

===================================================================

diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 6885a5a..ea24e91 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -146,6 +146,8 @@ MINLINE void negate_v4_v4(float r[4], const float a[3]);
 
 MINLINE void negate_v3_short(short r[3]);
 
+MINLINE void negate_v2_int(int r[2]);
+
 MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT;
 MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT;
 MINLINE float dot_v4v4(const float a[4], const float b[4]) ATTR_WARN_UNUSED_RESULT;
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index da9d5bd..1d1d662 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -611,6 +611,12 @@ MINLINE void negate_v3_short(short r[3])
 	r[2] = (short)-r[2];
 }
 
+MINLINE void negate_v2_int(int r[2])
+{
+	r[0] = -r[0];
+	r[1] = -r[1];
+}
+
 MINLINE float dot_v2v2(const float a[2], const float b[2])
 {
 	return a[0] * b[0] + a[1] * b[1];




More information about the Bf-blender-cvs mailing list