diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-29 05:51:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-29 05:51:27 +0400 |
commit | eb4090dadf31ccaf5277db6306302d70cc81d820 (patch) | |
tree | c03d14b3a262caa7e028142afb9d19864e8a8c8c /source/blender/blenlib | |
parent | 3f39af9cc2765c2cf3daab30c4ad0be58e341e19 (diff) |
Fix missing check if isect_plane_plane_v3 fails to find an intersection.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_math_geom.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index e99f89036b3..e800369a682 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -140,11 +140,11 @@ bool isect_ray_plane_v3(const float p1[3], const float d[3], bool isect_point_planes_v3(float (*planes)[4], int totplane, const float p[3]); 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 float plane_co[3], const float plane_no[3]) ATTR_WARN_UNUSED_RESULT; -void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], +bool 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]); + const float plane_b_co[3], const float plane_b_no[3]) ATTR_WARN_UNUSED_RESULT; /* line/ray triangle */ bool isect_line_tri_v3(const float p1[3], const float p2[3], diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 833a08cec60..bf5ae8fab4f 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1185,7 +1185,7 @@ bool isect_line_plane_v3(float out[3], * * \note return normal isn't unit length */ -void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], +bool 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]) { @@ -1193,7 +1193,7 @@ void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], cross_v3_v3v3(r_isect_no, plane_a_no, plane_b_no); /* direction is simply the cross product */ cross_v3_v3v3(plane_a_co_other, plane_a_no, r_isect_no); add_v3_v3(plane_a_co_other, plane_a_co); - isect_line_plane_v3(r_isect_co, plane_a_co, plane_a_co_other, plane_b_co, plane_b_no); + return isect_line_plane_v3(r_isect_co, plane_a_co, plane_a_co_other, plane_b_co, plane_b_no); } |