LinAl::Vector<T, D> half_dim = dimensions/T(2);
unsigned n = 0;
- T first_depth = T();
for(unsigned i=0; i<D; ++i)
{
if(!ray.get_direction()[i])
points[n].position = p;
points[n].normal = LinAl::Vector<T, D>();
points[n].normal[i] = j;
- if(n==0)
- first_depth = x;
- else if(n==1 && x<first_depth)
+ points[n].distance = x;
+
+ if(n==1 && x<points[0].distance)
std::swap(points[0], points[1]);
}
/* XXX This is not correct for nonuniform scaling. Inverse of the
transpose of the upper DxD part of the matrix should be used. */
points[i].normal = transformation.transform(points[i].normal);
+ points[i].distance = inner_product(points[i].position-ray.get_start(), ray.get_direction());
}
}
return count;