diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-04-10 15:18:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-04-10 15:46:12 +0300 |
commit | 50f9681e151361fe6685582cb887818fa2092131 (patch) | |
tree | ef62d82b3e790f055f96509444483cd52f2ed857 /source/blender/blenlib/intern/math_geom.c | |
parent | 019ce363b01bba0afe12a9b4c3f8a6409ea344fe (diff) |
Docs: comment on line-sphere intersection
Diffstat (limited to 'source/blender/blenlib/intern/math_geom.c')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index e1de4617037..482709e572f 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -839,6 +839,14 @@ bool isect_seg_seg_v2_simple(const float v1[2], const float v2[2], const float v * \param l1, l2: Coordinates (point of line). * \param sp, r: Coordinate and radius (sphere). * \return r_p1, r_p2: Intersection coordinates. + * + * \note The order of assignment for intersection points (\a r_p1, \a r_p2) is predictable, + * based on the direction defined by ``l2 - l1``, + * this direction compared with the normal of each point on the sphere: + * \a r_p1 always has a >= 0.0 dot product. + * \a r_p2 always has a <= 0.0 dot product. + * For example, when \a l1 is inside the sphere and \a l2 is outside, + * \a r_p1 will always be between \a l1 and \a l2. */ int isect_line_sphere_v3(const float l1[3], const float l2[3], const float sp[3], const float r, |