Fix Python ray-cast failing to check hit direction

This commit is contained in:
Campbell Barton 2014-10-08 09:42:34 +02:00
parent 47b8bf591c
commit a550d913bc
1 changed files with 5 additions and 0 deletions

View File

@ -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);