make instance's trafo function use the new class

This commit is contained in:
Michael Kirsch 2019-06-02 21:09:53 +02:00 committed by Joseph Lenox
parent 8928678085
commit ff201b5802

View File

@ -1124,12 +1124,11 @@ ModelInstance::transform_mesh(TriangleMesh* mesh, bool dont_translate) const
TransformationMatrix ModelInstance::get_trafo_matrix(bool dont_translate) const
{
TransformationMatrix trafo = TransformationMatrix();
trafo.scale(this->scaling_factor);
trafo.rotate(this->rotation, Axis::Z);
TransformationMatrix trafo = TransformationMatrix::mat_rotation(this->rotation, Axis::Z);
trafo.applyLeft(TransformationMatrix::mat_scale(this->scaling_factor));
if(!dont_translate)
{
trafo.translate(this->offset.x, this->offset.y, 0);
trafo.applyLeft(TransformationMatrix::mat_translation(this->offset.x, this->offset.y, 0));
}
return trafo;
}