- if (s < SCALAR(0.0) || s > SCALAR(1.0)) return SCALAR(-1.0);
-
- Scalar r = -(a[0] * (ray.point[1] - b[1]) +
- b[0] * (a[1] - ray.point[1]) +
- ray.point[0] * (b[1] - a[1])) / denom;
-
- // make sure we're dealing with the right side of the ray
- if (r < SCALAR(0.0)) return SCALAR(-1.0);
-
- intersection.point = ray.point + r * ray.direction;