add is_quad_convex_v2(), SET_UINT_IN_POINTER, GET_UINT_FROM_POINTER macros & some minor edits.
This commit is contained in:
@@ -55,6 +55,7 @@ float area_quad_v3(const float a[3], const float b[3], const float c[3], const f
|
||||
float area_poly_v3(int nr, float verts[][3], const float normal[3]);
|
||||
|
||||
int is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
|
||||
int is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
|
||||
|
||||
/********************************* Distance **********************************/
|
||||
|
||||
|
@@ -232,6 +232,10 @@
|
||||
#define SET_INT_IN_POINTER(i) ((void *)(intptr_t)(i))
|
||||
#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
|
||||
|
||||
#define SET_UINT_IN_POINTER(i) ((void *)(uintptr_t)(i))
|
||||
#define GET_UINT_FROM_POINTER(i) ((unsigned int)(uintptr_t)(i))
|
||||
|
||||
|
||||
/* Macro to convert a value to string in the preprocessor
|
||||
* STRINGIFY_ARG: gives the argument as a string
|
||||
* STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a',
|
||||
|
@@ -3278,3 +3278,10 @@ int is_quad_convex_v3(const float v1[3], const float v2[3], const float v3[3], c
|
||||
/* linetests, the 2 diagonals have to instersect to be convex */
|
||||
return (isect_line_line_v2(vec[0], vec[2], vec[1], vec[3]) > 0) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
int is_quad_convex_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
|
||||
{
|
||||
/* linetests, the 2 diagonals have to instersect to be convex */
|
||||
return (isect_line_line_v2(v1, v3, v2, v4) > 0) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,13 @@
|
||||
#include "DNA_vec_types.h"
|
||||
#include "BLI_rect.h"
|
||||
|
||||
/**
|
||||
* Determine if a rect is empty. An empty
|
||||
* rect is one with a zero (or negative)
|
||||
* width or height.
|
||||
*
|
||||
* \return True if \a rect is empty.
|
||||
*/
|
||||
int BLI_rcti_is_empty(const rcti *rect)
|
||||
{
|
||||
return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin));
|
||||
|
Reference in New Issue
Block a user