remove unused define CLAMPTEST, move INPR to
collision_compute_barycentric(), only place its used.
This commit is contained in:
@@ -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__
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user