Skip to content
Snippets Groups Projects
Commit bda3e70c authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

extended mol transform interface to accept pre-made mat4

parent 6d4c9ede
No related branches found
No related tags found
No related merge requests found
......@@ -72,18 +72,19 @@ BOOST_PYTHON_MODULE(_mol)
class_<Transform>("Transform", init<>())
.def(init<const Transform&>()) // shouldn't this be there automatically ?
.def("GetMatrix",&Transform::GetMatrix)
.add_property("matrix",&Transform::GetMatrix)
.def("SetMatrix",&Transform::SetMatrix)
.add_property("matrix",&Transform::GetMatrix,&Transform::SetMatrix)
.def("GetTransposedMatrix",&Transform::GetTransposedMatrix)
.add_property("tmatrix",&Transform::GetTransposedMatrix)
.add_property("tmatrix",&Transform::GetTransposedMatrix)
.def("SetTrans",&Transform::SetTrans)
.def("GetTrans",&Transform::GetTrans)
.add_property("trans",&Transform::GetTrans,&Transform::SetTrans)
.add_property("trans",&Transform::GetTrans,&Transform::SetTrans)
.def("SetCenter",&Transform::SetCenter)
.def("GetCenter",&Transform::GetCenter)
.add_property("center",&Transform::GetCenter,&Transform::SetCenter)
.add_property("center",&Transform::GetCenter,&Transform::SetCenter)
.def("SetRot",&Transform::SetRot)
.def("GetRot",&Transform::GetRot)
.add_property("rot",&Transform::GetRot,&Transform::SetRot)
.add_property("rot",&Transform::GetRot,&Transform::SetRot)
.def("ApplyXAxisRotation",&Transform::ApplyXAxisRotation)
.def("ApplyYAxisRotation",&Transform::ApplyYAxisRotation)
.def("ApplyZAxisRotation",&Transform::ApplyZAxisRotation)
......
......@@ -42,12 +42,17 @@ Mat4 Transform::GetMatrix() const
return tm_;
}
void Transform::SetMatrix(const Mat4& m)
{
tm_=m;
ttm_ = Transpose(tm_);
}
Mat4 Transform::GetTransposedMatrix() const
{
return ttm_;
}
void Transform::SetTrans(const Vec3& t)
{
trans_=t;
......
......@@ -41,7 +41,8 @@ public:
void SetCenter(const geom::Vec3& c);
geom::Vec3 GetCenter() const;
// directly set tm, messing up rot/trans/cen !
void SetMatrix(const geom::Mat4& m);
/// \name rotation
//@{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment