From acb518aceb276d70236022ffa32915c49874dfb2 Mon Sep 17 00:00:00 2001
From: Lukas Werner <lks.werner@fau.de>
Date: Wed, 14 Mar 2018 17:51:14 +0100
Subject: [PATCH] Now real_c's

---
 src/pe/ccd/HashGrids.h  | 6 +++---
 tests/pe/Raytracing.cpp | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/pe/ccd/HashGrids.h b/src/pe/ccd/HashGrids.h
index 4b6392b2d..df5fab20e 100644
--- a/src/pe/ccd/HashGrids.h
+++ b/src/pe/ccd/HashGrids.h
@@ -640,9 +640,9 @@ BodyID HashGrids::HashGrid::getRayIntersectingBody(const raytracing::Ray& ray, c
    const int8_t stepY = ray.yDir() >= 0 ? 1 : -1;
    const int8_t stepZ = ray.zDir() >= 0 ? 1 : -1;
    
-   Vec3 near((stepX >= 0) ? (firstCell[0]+1)*cellSpan_-firstPoint[0] : firstPoint[0]-firstCell[0]*cellSpan_,
-             (stepY >= 0) ? (firstCell[1]+1)*cellSpan_-firstPoint[1] : firstPoint[1]-firstCell[1]*cellSpan_,
-             (stepZ >= 0) ? (firstCell[2]+1)*cellSpan_-firstPoint[2] : firstPoint[2]-firstCell[2]*cellSpan_);
+   Vec3 near((stepX >= 0) ? real_c(firstCell[0]+1)*cellSpan_-firstPoint[0] : firstPoint[0]-real_c(firstCell[0])*cellSpan_,
+             (stepY >= 0) ? real_c(firstCell[1]+1)*cellSpan_-firstPoint[1] : firstPoint[1]-real_c(firstCell[1])*cellSpan_,
+             (stepZ >= 0) ? real_c(firstCell[2]+1)*cellSpan_-firstPoint[2] : firstPoint[2]-real_c(firstCell[2])*cellSpan_);
    
    // tMax: distance along the ray to the next cell change in the axis direction
    real_t tMaxX = (!realIsEqual(ray.xDir(), 0)) ? std::abs(near[0]*ray.xInvDir()) : inf;
diff --git a/tests/pe/Raytracing.cpp b/tests/pe/Raytracing.cpp
index 4d227aed1..6f72720bf 100644
--- a/tests/pe/Raytracing.cpp
+++ b/tests/pe/Raytracing.cpp
@@ -753,12 +753,12 @@ void HashGridsTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RA
    
    // cubes on z = 0 plane
    for (int i = 0; ; ++i) {
-      x_min = forestAABB.xMin() + i*(gap+len);
+      x_min = forestAABB.xMin() + real_c(i)*(gap+len);
       if (x_min > forestAABB.max(0)) {
          break;
       }
       for (int j = 0; ; ++j) {
-         y_min = forestAABB.yMin() + j*(gap+len);
+         y_min = forestAABB.yMin() + real_c(j)*(gap+len);
          if (y_min > forestAABB.max(1)) {
             break;
          }
@@ -769,12 +769,12 @@ void HashGridsTestScene(Raytracer::Algorithm raytracingAlgorithm = Raytracer::RA
    
    //cubes on z = max plane
    for (int i = 0; ; ++i) {
-      x_min = forestAABB.xMin() + i*(gap+len);
+      x_min = forestAABB.xMin() + real_c(i)*(gap+len);
       if (x_min > forestAABB.max(0)) {
          break;
       }
       for (int j = 0; ; ++j) {
-         y_min = forestAABB.yMin() + j*(gap+len);
+         y_min = forestAABB.yMin() + real_c(j)*(gap+len);
          if (y_min > forestAABB.max(1)) {
             break;
          }
-- 
GitLab