Skip to content

Commit

Permalink
matrix template for transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 23, 2023
1 parent 6d5e0b5 commit 2411051
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions include/vclib/math/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,18 @@ void setTransformMatrixRotationDeg(
setTransformMatrixRotation(matrix, axis, vcl::toRad(angleDeg));
}

template<typename ScalarType, PointConcept PointType>
template<typename MatrixType, PointConcept PointType>
void setTrasformMatrixTranslation(
Matrix44<ScalarType>& matrix,
const PointType& translation)
MatrixType& matrix,
const PointType& translation)
{
matrix(0, 3) = translation[0];
matrix(1, 3) = translation[1];
matrix(2, 3) = translation[2];
}

template<typename ScalarType, PointConcept PointType>
void setTrasformMatrixScale(
Matrix44<ScalarType>& matrix,
const PointType& scale)
template<typename MatrixType, PointConcept PointType>
void setTrasformMatrixScale(MatrixType& matrix, const PointType& scale)
{
matrix(0, 0) = scale[0];
matrix(1, 1) = scale[0];
Expand Down

0 comments on commit 2411051

Please sign in to comment.