*/
double cx = (p.x() - p00.x()) / (p10.x() - p00.x());
double cz = (p.z() - p10.z()) / (p11.z() - p10.z());
if (cx > cz) {
Intersection x = newIntersection(ray, t, ray.direction().dot(plane.normal()) < 0.0)
.setBasis(Basis3.fromW(plane.normal(), Basis3.Orientation.RIGHT_HANDED))
.setLocation(p);
recorder.record(x);
hit = true;
}
}
plane = Plane3.throughPoints(p00, p11, p01);
t = plane.intersect(ray);
if (I.contains(t)) {
Point3 p = ray.pointAt(t);
/* Get the normalized (x,z) coordinates, (cx, cz),
* within the bounds of the cell. If cx < cz, then
* the intersection hit the triangle, otherwise, it hit
* the plane, but on the other half of the cell.
*/
double cx = (p.x() - p00.x()) / (p10.x() - p00.x());
double cz = (p.z() - p10.z()) / (p11.z() - p10.z());
if (cx < cz) {
Intersection x = newIntersection(ray, t, ray.direction().dot(plane.normal()) < 0.0)
.setBasis(Basis3.fromW(plane.normal(), Basis3.Orientation.RIGHT_HANDED))
.setLocation(p);
recorder.record(x);