diff --git a/vcg/math/deprecated_matrix44.h b/vcg/math/deprecated_matrix44.h index 28edbfc0..5c8c765a 100644 --- a/vcg/math/deprecated_matrix44.h +++ b/vcg/math/deprecated_matrix44.h @@ -253,6 +253,8 @@ public: void SetDiagonal(const T k); Matrix44 &SetScale(const T sx, const T sy, const T sz); Matrix44 &SetScale(const Point3 &t); + Matrix44& SetColumn(const unsigned int ii,const Point4 &t); + Matrix44& SetColumn(const unsigned int ii,const Point3 &t); Matrix44 &SetTranslate(const Point3 &t); Matrix44 &SetTranslate(const T sx, const T sy, const T sz); Matrix44 &SetShearXY(const T sz); @@ -567,6 +569,24 @@ template Matrix44 &Matrix44::SetTranslate(const T tx, const T ty return *this; } +template Matrix44 &Matrix44::SetColumn(const unsigned int ii,const Point3 &t) { + assert((ii >= 0) && (ii < 4)); + ElementAt(0, ii) = t.X(); + ElementAt(1, ii) = t.Y(); + ElementAt(2, ii) = t.Z(); + return *this; +} + +template Matrix44 &Matrix44::SetColumn(const unsigned int ii,const Point4 &t) { + assert((ii >= 0) && (ii < 4)); + ElementAt(0, ii) = t.X(); + ElementAt(1, ii) = t.Y(); + ElementAt(2, ii) = t.Z(); + ElementAt(3, ii) = t.W(); + return *this; +} + + template Matrix44 &Matrix44::SetRotateDeg(T AngleDeg, const Point3 & axis) { return SetRotateRad(math::ToRad(AngleDeg),axis); }