diff options
Diffstat (limited to 'source/blender/blenlib/intern/math_geom.c')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 34c8b9fabe6..0e7358aa426 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2003,6 +2003,23 @@ bool isect_point_planes_v3(float (*planes)[4], int totplane, const float p[3]) } /** + * Check if a point is in front all planes. + * Same as isect_point_planes_v3 but with planes facing the opposite direction. + */ +bool isect_point_planes_v3_negated( + const float(*planes)[4], const int totplane, const float p[3]) +{ + for (int i = 0; i < totplane; i++) { + if (plane_point_side_v3(planes[i], p) <= 0.0f) { + return false; + } + } + + return true; +} + + +/** * Intersect line/plane. * * \param r_isect_co The intersection point. |