Przeglądaj źródła

overzealous asserts

Former-commit-id: f774cd9d96ed7133f74a83725dbf439d3bb1bdab
Alec Jacobson 9 lat temu
rodzic
commit
3d8121a9a6
2 zmienionych plików z 5 dodań i 5 usunięć
  1. 3 3
      include/igl/Camera.h
  2. 2 2
      include/igl/embree/EmbreeIntersector.h

+ 3 - 3
include/igl/Camera.h

@@ -347,10 +347,10 @@ inline void igl::Camera::look_at(
   //cout<<"eye()-at(): "<<(this->eye()-this->at()).normalized().transpose()<<endl;
   //cout<<"eye-this->eye(): "<<(eye-this->eye()).squaredNorm()<<endl;
   assert(           (eye-this->eye()).squaredNorm() < DOUBLE_EPS);
-  assert((F-(this->eye()-this->at()).normalized()).squaredNorm() < 
-    DOUBLE_EPS);
+  //assert((F-(this->eye()-this->at()).normalized()).squaredNorm() < 
+  //  DOUBLE_EPS);
   assert(           (at-this->at()).squaredNorm() < DOUBLE_EPS);
-  assert(        (proj_up-this->up()).squaredNorm() < DOUBLE_EPS);
+  //assert(        (proj_up-this->up()).squaredNorm() < DOUBLE_EPS);
 }
 
 #endif

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

@@ -333,7 +333,7 @@ igl::embree::EmbreeIntersector
 
 void igl::embree::EmbreeIntersector::deinit()
 {
-  if(scene)
+  if(EmbreeIntersector_inited && scene)
   {
     rtcDeleteScene(scene);
 
@@ -413,7 +413,7 @@ inline bool igl::embree::EmbreeIntersector::intersectBeam(
 
   Eigen::Matrix3f rot = Eigen::AngleAxis<float>(2*3.14159265358979/samples,direction).toRotationMatrix();
 
-  for(int r=0;r<samples;r++)
+  for(int r=0;r<(int)samples;r++)
   {
     if(intersectRay(origin+offset*eps,direction,hit,tnear,tfar,mask) && 
         ((closestHit && (hit.t < bestHit.t)) ||