diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 16:56:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 16:56:02 +0400 |
commit | 7fac20008000c095f48679a045cdfab5db1aeba2 (patch) | |
tree | 6343c0638361da17e596a2efc56271b9149b88f5 | |
parent | 3b341068ba6be81083644ca56649466ad933fdbb (diff) |
remove unused define CLAMPTEST, move INPR to
collision_compute_barycentric(), only place its used.
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 5 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 9 |
2 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 4bfe3b1c0bd..91a09bb8554 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -164,6 +164,9 @@ Collision modifier code end // w3 is not perfect static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3 ) { + /* dot_v3v3 */ +#define INPR(v1, v2) ( (v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2]) + double tempV1[3], tempV2[3], tempV4[3]; double a, b, c, d, e, f; @@ -195,6 +198,8 @@ static void collision_compute_barycentric ( float pv[3], float p1[3], float p2[3 w2[0] = 0; w3[0] = 1.0f - w1[0] - w2[0]; + +#undef INPR } #ifdef __GNUC__ diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index bd6057f8b8f..1a0073a8f13 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -266,8 +266,6 @@ typedef bool _BLI_Bool; *(v1 + 2) = *(v2 + 2) - *(v3 + 2) * (fac); \ } (void)0 -#define INPR(v1, v2) ( (v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2]) - /* some misc stuff.... */ #define CLAMP(a, b, c) { \ if ((a) < (b)) (a) = (b); \ @@ -275,13 +273,6 @@ typedef bool _BLI_Bool; } (void)0 #define CLAMPIS(a, b, c) ((a) < (b) ? (b) : (a) > (c) ? (c) : (a)) -#define CLAMPTEST(a, b, c) \ - if ((b) < (c)) { \ - CLAMP(a, b, c); \ - } \ - else { \ - CLAMP(a, c, b); \ - } (void)0 #define IS_EQ(a, b) ((fabs((double)(a) - (b)) >= (double) FLT_EPSILON) ? 0 : 1) #define IS_EQF(a, b) ((fabsf((float)(a) - (b)) >= (float) FLT_EPSILON) ? 0 : 1) |