src/linetypes/modelobject.cpp

changeset 1426
e5a2ddfe2ba5
parent 1423
6608db56b047
child 1440
265b2e95a8e8
equal deleted inserted replaced
1425:5354313b9958 1426:e5a2ddfe2ba5
306 void LDObject::move(const QVector3D& vector) 306 void LDObject::move(const QVector3D& vector)
307 { 307 {
308 if (hasMatrix()) 308 if (hasMatrix())
309 { 309 {
310 LDMatrixObject* mo = static_cast<LDMatrixObject*> (this); 310 LDMatrixObject* mo = static_cast<LDMatrixObject*> (this);
311 mo->translate(vector); 311 QMatrix4x4 matrix = mo->transformationMatrix();
312 matrix(0, 3) += vector.x();
313 matrix(1, 3) += vector.y();
314 matrix(2, 3) += vector.z();
315 mo->setTransformationMatrix(matrix);
312 } 316 }
313 else 317 else
314 { 318 {
315 for (int i = 0; i < numVertices(); ++i) 319 for (int i = 0; i < numVertices(); ++i)
316 setVertex (i, vertex (i) + vector); 320 setVertex (i, vertex (i) + vector);

mercurial