Fix preshear transformation.

Fixes #2777.  The `preshear` function seems to have always used an invalid constructor
internally, and has been broken for a while.  Fixed the implementation and added a test.

(cherry picked from commit 45da84e21570bf70238cf489ad862b2f09242c5f)
This commit is contained in:
Antonio Sanchez
2024-01-29 12:23:51 -08:00
parent b86ac5f1e7
commit 42b04a08c4
2 changed files with 8 additions and 1 deletions

View File

@@ -985,7 +985,8 @@ Transform<Scalar,Dim,Mode,Options>::preshear(const Scalar& sx, const Scalar& sy)
{
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
m_matrix.template block<Dim,HDim>(0,0) = LinearMatrixType(1, sx, sy, 1) * m_matrix.template block<Dim,HDim>(0,0);
m_matrix.template block<Dim, HDim>(0, 0) =
LinearMatrixType({{1, sy}, {sx, 1}}) * m_matrix.template block<Dim, HDim>(0, 0);
return *this;
}