Make Transform::computeRotationScaling(0,&S) continuous

This commit is contained in:
Essex Edwards
2020-12-14 13:03:46 -08:00
committed by Antonio Sánchez
parent 0bdc0dba20
commit e741b43668
2 changed files with 32 additions and 4 deletions

View File

@@ -1101,12 +1101,12 @@ EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeRotationScalin
Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1
VectorType sv(svd.singularValues());
sv.coeffRef(0) *= x;
sv.coeffRef(Dim-1) *= x;
if(scaling) *scaling = svd.matrixV() * sv.asDiagonal() * svd.matrixV().adjoint();
if(rotation)
{
LinearMatrixType m(svd.matrixU());
m.col(0) /= x;
m.col(Dim-1) /= x;
*rotation = m * svd.matrixV().adjoint();
}
}
@@ -1130,12 +1130,12 @@ EIGEN_DEVICE_FUNC void Transform<Scalar,Dim,Mode,Options>::computeScalingRotatio
Scalar x = (svd.matrixU() * svd.matrixV().adjoint()).determinant(); // so x has absolute value 1
VectorType sv(svd.singularValues());
sv.coeffRef(0) *= x;
sv.coeffRef(Dim-1) *= x;
if(scaling) *scaling = svd.matrixU() * sv.asDiagonal() * svd.matrixU().adjoint();
if(rotation)
{
LinearMatrixType m(svd.matrixU());
m.col(0) /= x;
m.col(Dim-1) /= x;
*rotation = m * svd.matrixV().adjoint();
}
}