]> git.tdb.fi Git - libs/math.git/commitdiff
Minor fixes
authorMikko Rasa <tdb@tdb.fi>
Sat, 2 Jul 2016 15:36:04 +0000 (18:36 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 2 Jul 2016 15:36:04 +0000 (18:36 +0300)
source/geometry/extrudedshape.h

index a62aa9a311e88bf09dd9fa5d480b425baaf38758..78dfa4911463e57951eaa0ca4524c223ab9ce9b5 100644 (file)
@@ -116,7 +116,7 @@ inline unsigned ExtrudedShape<T, D>::get_intersections(const Ray<T, D> &ray, Sur
        {
                T offset = T();
                T limit = T();
-               if(ray.get_direction()[D-1]!=T(0))
+               if(ray_direction[D-1]!=T(0))
                {
                        offset = (half_length-ray_start[D-1])/ray_direction[D-1];
                        limit = (-half_length-ray_start[D-1])/ray_direction[D-1];
@@ -157,7 +157,7 @@ inline unsigned ExtrudedShape<T, D>::get_intersections(const Ray<T, D> &ray, Sur
 
        /* If the ray is not parallel to the base space, it may pass through the
        caps. */
-       if(n<size && ray_direction[D-1])
+       if(n<size && ray_direction[D-1]!=T(0))
        {
                for(int i=-1; (n<size && i<=1); i+=2)
                {