From aa1668c6f8a70e41b97b67f31647dbec382e19f7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 Jul 2011 08:13:27 +0000 Subject: [PATCH] fix for own error in intersect_line_sphere_2d(), using 3d function on 2d vectors --- source/blender/blenlib/intern/math_geom.c | 2 +- source/blender/python/generic/mathutils_geometry.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 9d945e9baa3..fc329fe1bf1 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -430,7 +430,7 @@ int isect_line_sphere_v2(const float l1[2], const float l2[2], l2[1] - l1[1] }; - const float a= dot_v3v3(ldir, ldir); + const float a= dot_v2v2(ldir, ldir); const float b= 2.0f * (ldir[0] * (l1[0] - sp[0]) + diff --git a/source/blender/python/generic/mathutils_geometry.c b/source/blender/python/generic/mathutils_geometry.c index 55c1e69d558..26844a5003d 100644 --- a/source/blender/python/generic/mathutils_geometry.c +++ b/source/blender/python/generic/mathutils_geometry.c @@ -680,7 +680,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO PyObject *ret= PyTuple_New(2); - switch(isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) { + switch(isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) { case 1: if(!(!clip || (((lambda= line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a= FALSE; use_b= FALSE;