Browse Source

fixed bugs in EmbreeIntersector

Former-commit-id: 51eba9f5da78216bc98d2780db4ca4fdf2431516
schuellc 10 years ago
parent
commit
e6d9d615fe
1 changed files with 3 additions and 3 deletions
  1. 3 3
      include/igl/embree/EmbreeIntersector.h

+ 3 - 3
include/igl/embree/EmbreeIntersector.h

@@ -118,7 +118,7 @@ namespace igl
       const Eigen::RowVector3f& direction,
       Hit& hit,
       float tnear = 0,
-      float tfar = -1,
+      float tfar = std::numeric_limits<float>::infinity(),
       int mask = 0xFFFFFFFF,
       int geoId = -1,
       bool closestHit = true,
@@ -394,7 +394,7 @@ inline bool igl::EmbreeIntersector::intersectBeam(
   else
     bestHit.t = 0;
 
-  if(hasHit = ((intersectRay(origin,direction,hit,tnear,tfar,mask)) && (hit.gid == geoId || geoId == -1)))
+  if(hasHit = (intersectRay(origin,direction,hit,tnear,tfar,mask) && (hit.gid == geoId || geoId == -1)))
     bestHit = hit;
   
   // sample points around actual ray (conservative hitcheck)
@@ -442,7 +442,7 @@ igl::EmbreeIntersector
   double min_t = tnear;
   bool large_hits_warned = false;
   RTCRay ray;
-  createRay(ray,origin,direction,tnear,std::numeric_limits<float>::infinity(),mask);
+  createRay(ray,origin,direction,tnear,tfar,mask);
 
   while(true)
   {