From a91964e0e2f6758e076b522724bb1bc63933cb91 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Jun 2013 21:25:27 +0000 Subject: code cleanup: use boolean for intersection functions. --- source/blender/blenlib/BLI_math_geom.h | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'source/blender/blenlib/BLI_math_geom.h') diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 4ebb1a1a1d9..96652c0e78d 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -111,30 +111,30 @@ int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], co int isect_line_line_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float i1[3], float i2[3]); -int isect_line_line_strict_v3(const float v1[3], const float v2[3], - const float v3[3], const float v4[3], - float vi[3], float *r_lambda); +bool isect_line_line_strict_v3(const float v1[3], const float v2[3], + const float v3[3], const float v4[3], + float vi[3], float *r_lambda); -int isect_ray_plane_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], - float *r_lambda, const int clip); +bool isect_ray_plane_v3(const float p1[3], const float d[3], + const float v0[3], const float v1[3], const float v2[3], + float *r_lambda, const int clip); -int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], - const float plane_co[3], const float plane_no[3], const bool no_flip); +bool isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], + const float plane_co[3], const float plane_no[3], const bool no_flip); void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], const float plane_a_co[3], const float plane_a_no[3], const float plane_b_co[3], const float plane_b_no[3]); /* line/ray triangle */ -int isect_line_tri_v3(const float p1[3], const float p2[3], +bool isect_line_tri_v3(const float p1[3], const float p2[3], + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); +bool isect_ray_tri_v3(const float p1[3], const float d[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); -int isect_ray_tri_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); -int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float threshold); -int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon); +bool isect_ray_tri_threshold_v3(const float p1[3], const float d[3], + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float threshold); +bool isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon); /* point in polygon */ bool isect_point_poly_v2(const float pt[2], const float verts[][2], const int nr); @@ -145,14 +145,14 @@ int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], co int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2]); int isect_point_tri_v2_cw(const float pt[2], const float v1[2], const float v2[2], const float v3[2]); int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b); -int isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]); +bool isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]); void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float r_uv[2]); void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2], const float v3[2], const float pt[2], float r_uv[2]); /* axis-aligned bounding box */ -int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]); +bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]); typedef struct { float ray_start[3]; @@ -161,14 +161,14 @@ typedef struct { } IsectRayAABBData; void isect_ray_aabb_initialize(IsectRayAABBData *data, const float ray_start[3], const float ray_direction[3]); -int isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], const float bb_max[3], float *tmin); +bool isect_ray_aabb(const IsectRayAABBData *data, const float bb_min[3], const float bb_max[3], float *tmin); /* other */ -int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]); +bool isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]); -int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda); +bool isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3], + const float v0[3], const float v1[3], const float v2[3], float *r_lambda); bool clip_segment_v3_plane(float p1[3], float p2[3], const float plane[4]); bool clip_segment_v3_plane_n(float p1[3], float p2[3], float plane_array[][4], const int plane_tot); -- cgit v1.2.3