]> git.tdb.fi Git - libs/math.git/commitdiff
Transform normals correctly
authorMikko Rasa <tdb@tdb.fi>
Tue, 21 May 2013 13:19:56 +0000 (16:19 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 21 May 2013 13:19:56 +0000 (16:19 +0300)
source/geometry/transformedshape.h

index 90c37b0bb0a2b234c0e7929796846c25cc7e4648..bf508f9b1da31be6145fd972e350481b9502d74b 100644 (file)
@@ -115,7 +115,7 @@ inline unsigned TransformedShape<T, D>::get_intersections(const Ray<T, D> &ray,
                        points[i].position = transformation.transform(points[i].position);
                        /* 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].normal = transformation.transform_linear(points[i].normal);
                        points[i].distance = inner_product(points[i].position-ray.get_start(), ray.get_direction());
                }
        }