- // 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;
-
- // gotta use the correct normal
- Vector n = cml::perp(a - b);
- if (cml::dot(a - ray.point, n) < 0) intersection.normal = n;
- else intersection.normal = -n;
-
- return r;
+ Vector normal = cml::perp(a - b);
+ if (cml::dot(a - ray.point, normal) < 0) hit.normal = normal;
+ else hit.normal = -normal;
+ return true;