Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-10-08 11:42:34 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-10-15 15:06:10 +0400
commit11bbe69b2af06b388e18999076245454cd1192fd (patch)
tree6a9b810e2e5da079c9a50cd14006fcdbd66d7404
parentc2ef758cbeefc250c04ffa309d2bbfae0d4168dd (diff)
Fix Python ray-cast failing to check hit direction
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c
index b4add0fc615..0f0ffe9fec5 100644
--- a/source/blender/python/mathutils/mathutils_geometry.c
+++ b/source/blender/python/mathutils/mathutils_geometry.c
@@ -149,6 +149,11 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject *
/* calculate t, ray intersects triangle */
t = dot_v3v3(e2, qvec) * inv_det;
+ /* ray hit behind */
+ if (t < 0.0f) {
+ Py_RETURN_NONE;
+ }
+
mul_v3_fl(dir, t);
add_v3_v3v3(pvec, orig, dir);