]> git.tdb.fi Git - libs/math.git/blobdiff - source/geometry/transformedshape.h
Record distance in SurfacePoint
[libs/math.git] / source / geometry / transformedshape.h
index 01253680f6340a9ed277f76664b906313f8314e2..34fd2989f2cfeaadddcf40ef6822ae2fb37c62d0 100644 (file)
@@ -107,6 +107,7 @@ inline unsigned TransformedShape<T, D>::get_intersections(const Ray<T, D> &ray,
                        /* 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;