compilation fixes with Eigen
This commit is contained in:
parent
1608800d69
commit
9608ec798b
|
@ -867,7 +867,7 @@ static void VertexCoordViewDepth(MeshType &m,
|
||||||
{
|
{
|
||||||
CoordType np = TD[*vi].sum/TD[*vi].cnt;
|
CoordType np = TD[*vi].sum/TD[*vi].cnt;
|
||||||
CoordType d = (*vi).cP() - viewpoint; d.Normalize();
|
CoordType d = (*vi).cP() - viewpoint; d.Normalize();
|
||||||
ScalarType s = d * ( np - (*vi).cP() );
|
ScalarType s = d .dot ( np - (*vi).cP() );
|
||||||
(*vi).P() += d * (s*alpha);
|
(*vi).P() += d * (s*alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#define EIGEN_VCGLIB
|
#define EIGEN_VCGLIB
|
||||||
|
|
||||||
// TODO enable the vectorization
|
// TODO enable the vectorization
|
||||||
#define EIGEN_DONT_VECTORIZE
|
// #define EIGEN_DONT_VECTORIZE
|
||||||
#define EIGEN_MATRIXBASE_PLUGIN <vcg/math/eigen_matrixbase_addons.h>
|
#define EIGEN_MATRIXBASE_PLUGIN <vcg/math/eigen_matrixbase_addons.h>
|
||||||
#define EIGEN_MATRIX_PLUGIN <vcg/math/eigen_matrix_addons.h>
|
#define EIGEN_MATRIX_PLUGIN <vcg/math/eigen_matrix_addons.h>
|
||||||
|
|
||||||
|
|
|
@ -216,12 +216,18 @@ void Trackball::ApplyInverse() {
|
||||||
|
|
||||||
// T(c) S R T(t) T(-c) => S R T(S^(-1) R^(-1)(c) + t - c)
|
// T(c) S R T(t) T(-c) => S R T(S^(-1) R^(-1)(c) + t - c)
|
||||||
Matrix44f Trackball::Matrix() const{
|
Matrix44f Trackball::Matrix() const{
|
||||||
|
#ifndef VCG_USE_EIGEN
|
||||||
Matrix44f r; track.rot.ToMatrix(r);
|
Matrix44f r; track.rot.ToMatrix(r);
|
||||||
Matrix44f sr = Matrix44f().SetScale(track.sca, track.sca, track.sca) * r;
|
Matrix44f sr = Matrix44f().SetScale(track.sca, track.sca, track.sca) * r;
|
||||||
Matrix44f s_inv = Matrix44f().SetScale(1/track.sca, 1/track.sca, 1/track.sca);
|
Matrix44f s_inv = Matrix44f().SetScale(1/track.sca, 1/track.sca, 1/track.sca);
|
||||||
Matrix44f t = Matrix44f().SetTranslate(s_inv*r.transpose()*center + track.tra - center);
|
Matrix44f t = Matrix44f().SetTranslate(s_inv*r.transpose()*center + track.tra - center);
|
||||||
|
|
||||||
return Matrix44f(sr*t);
|
return Matrix44f(sr*t);
|
||||||
|
#else
|
||||||
|
Eigen::Quaternionf rot(track.rot);
|
||||||
|
Eigen::Translation3f tr( (1/track.sca) * (rot.inverse() * center) + track.tra - center );
|
||||||
|
return ( Eigen::Scaling3f(track.sca) * (rot * tr) ).matrix();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix44f Trackball::InverseMatrix() const{
|
Matrix44f Trackball::InverseMatrix() const{
|
||||||
|
|
Loading…
Reference in New Issue