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_base.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_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index af301386920..d9161aa2024 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -37,6 +37,7 @@ extern "C" { #endif #include <math.h> +#include "BLI_math_inline.h" #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -130,23 +131,30 @@ extern "C" { #define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) #endif +#ifdef BLI_MATH_INLINE +#include "intern/math_base_inline.c" +#endif + /******************************* Float ******************************/ -float sqrt3f(float f); -double sqrt3d(double d); +MINLINE float sqrt3f(float f); +MINLINE double sqrt3d(double d); + +MINLINE float saacosf(float f); +MINLINE float saasinf(float f); +MINLINE float sasqrtf(float f); +MINLINE float saacos(float fac); +MINLINE float saasin(float fac); +MINLINE float sasqrt(float fac); -float saacosf(float f); -float saasinf(float f); -float sasqrtf(float f); -float saacos(float fac); -float saasin(float fac); -float sasqrt(float fac); +MINLINE float interpf(float a, float b, float t); -float interpf(float a, float b, float t); +MINLINE float minf(float a, float b); +MINLINE float maxf(float a, float b); -float power_of_2(float f); +MINLINE float power_of_2(float f); -float shell_angle_to_dist(float angle); +MINLINE float shell_angle_to_dist(float angle); double double_round(double x, int ndigits); |