Эх сурвалжийг харах

template

Former-commit-id: d6abb54d01879676bab7a142394ceecc04f1d3e7
Alec Jacobson (jalec 11 жил өмнө
parent
commit
1a493e2836

+ 2 - 0
include/igl/Camera.h

@@ -354,6 +354,7 @@ inline void igl::Camera::look_at(
   m_at_dist = F.norm();
   F.normalize();
   // Project up onto plane orthogonal to F and normalize
+  assert(up.cross(F).norm() > DOUBLE_EPS && "(eye-at) x up ≈ 0");
   const Vector3d proj_up = (up-(up.dot(F))*F).normalized();
   Quaterniond a,b;
   a.setFromTwoVectors(Vector3d(0,0,-1),-F);
@@ -366,6 +367,7 @@ inline void igl::Camera::look_at(
   //cout<<"eye(): "<<this->eye().transpose()<<endl;
   //cout<<"at(): "<<this->at().transpose()<<endl;
   //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);

+ 1 - 0
include/igl/report_gl_error.cpp

@@ -8,6 +8,7 @@
 #include "report_gl_error.h"
 #ifndef IGL_NO_OPENGL
 
+#include <cstdio>
 #include "verbose.h"
 
 IGL_INLINE GLenum igl::report_gl_error(const std::string id)

+ 0 - 1
include/igl/report_gl_error.h

@@ -12,7 +12,6 @@
 
 #include "OpenGL_convenience.h"
 
-#include <cstdio>
 #include <string>
 
 namespace igl

+ 1 - 0
include/igl/unproject.cpp

@@ -62,6 +62,7 @@ template int igl::unproject<Eigen::Matrix<float, 3, 1, 0, 3, 1>, Eigen::Matrix<f
 template Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > igl::unproject<Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> > const&);
 template int igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<float, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<float, 3, 1, 0, 3, 1> >&);
 template Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > igl::unproject<Eigen::Matrix<double, 3, 1, 0, 3, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&);
+template int igl::unproject<Eigen::Matrix<double, 1, 3, 1, 1, 3>, Eigen::Matrix<double, 1, 3, 1, 1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, 1, 3, 1, 1, 3> >&);
 #endif
 
 #endif