mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Make Transform::computeRotationScaling(0,&S) continuous
This commit is contained in:
committed by
Antonio Sánchez
parent
0bdc0dba20
commit
e741b43668
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user