mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-12 19:20:36 +08:00
Fix preshear transformation.
This commit is contained in:
parent
69ee52ed13
commit
043442e21b
@ -943,7 +943,8 @@ EIGEN_DEVICE_FUNC Transform<Scalar, Dim, Mode, Options>& Transform<Scalar, Dim,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -273,6 +273,12 @@ void transformations() {
|
||||
.matrix()
|
||||
.isIdentity(test_precision<Scalar>()));
|
||||
|
||||
t20.setIdentity();
|
||||
t20.shear(Scalar(2), Scalar(3));
|
||||
Transform2 t23 = t20 * t21;
|
||||
t21.preshear(Scalar(2), Scalar(3));
|
||||
VERIFY_IS_APPROX(t21, t23);
|
||||
|
||||
// Transform - new API
|
||||
// 3D
|
||||
t0.setIdentity();
|
||||
|
Loading…
x
Reference in New Issue
Block a user