mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-26 06:44:27 +08:00
optimization: spare the 3x3 matrix product in
fromPositionOrientationScale
This commit is contained in:
parent
6a36b5a6e0
commit
d3529e9c40
@ -388,10 +388,10 @@ Transform<Scalar,Dim>::fromPositionOrientationScale(const MatrixBase<PositionDer
|
|||||||
const OrientationType& orientation, const MatrixBase<ScaleDerived> &scale)
|
const OrientationType& orientation, const MatrixBase<ScaleDerived> &scale)
|
||||||
{
|
{
|
||||||
linear() = ToRotationMatrix<Scalar,Dim,OrientationType>::convert(orientation);
|
linear() = ToRotationMatrix<Scalar,Dim,OrientationType>::convert(orientation);
|
||||||
|
for(int i = 0; i < Dim; i++) linear().col(i) *= scale.coeff(i);
|
||||||
translation() = position;
|
translation() = position;
|
||||||
m_matrix(Dim,Dim) = 1.;
|
m_matrix(Dim,Dim) = 1.;
|
||||||
m_matrix.template block<1,Dim>(Dim,0).setZero();
|
m_matrix.template block<1,Dim>(Dim,0).setZero();
|
||||||
linear() *= scale.asDiagonal();
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user