diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-22 14:10:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-01-22 14:10:24 +0300 |
commit | 8ec59c7c687b9e50c48a9d455b31ff4c01df69d2 (patch) | |
tree | 32bf65aad65475c5dd9aeefa9067eba21e7324fb /source/blender/blenlib/BLI_math_vector.h | |
parent | 2d2339a70992b819a23e8c71f68027022b395f46 (diff) |
Math Lib:
* inline some more functions, from math_base and math_vector
* also made some changes to the way inline is done so it can
work for more than one file
* reflect_v3_v3v3 requires input vectors to be normalized now.
* added rgb_to_grayscale
* added zero_v4, copy_v4_v4, swap_v4_v4, is_one_v3
* added box_clip_bounds_m4 to clip a bounding box against a
projection matrix
Diffstat (limited to 'source/blender/blenlib/BLI_math_vector.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 9fb9e36bd2b..125e02bb481 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -32,30 +32,23 @@ extern "C" { #endif -/* add platform/compiler checks here if it is not supported */ -#define BLI_MATH_INLINE - #ifdef BLI_MATH_INLINE -#ifdef _MSC_VER -#define MINLINE static __inline -#else -#define MINLINE static inline -#endif #include "intern/math_vector_inline.c" -#else -#define MINLINE #endif /************************************* Init ***********************************/ MINLINE void zero_v2(float r[2]); MINLINE void zero_v3(float r[3]); +MINLINE void zero_v4(float r[4]); 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], float a[4]); 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]); /********************************* Arithmetic ********************************/ @@ -118,12 +111,14 @@ void mid_v3_v3v3(float r[3], float a[3], float b[3]); /********************************* Comparison ********************************/ -int is_zero_v3(float a[3]); -int equals_v3v3(float a[3], float b[3]); -int compare_v3v3(float a[3], float b[3], float limit); -int compare_len_v3v3(float a[3], float b[3], float limit); +MINLINE int is_zero_v3(float a[3]); +MINLINE int is_one_v3(float a[3]); + +MINLINE int equals_v3v3(float a[3], float b[3]); +MINLINE int compare_v3v3(float a[3], float b[3], float limit); +MINLINE int compare_len_v3v3(float a[3], float b[3], float limit); -int compare_v4v4(float a[4], float b[4], float limit); +MINLINE int compare_v4v4(float a[4], float b[4], float limit); /********************************** Angles ***********************************/ /* - angle with 2 arguments is angle between vector */ |