MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / transformComponents

Method transformComponents

radiantcore/patch/PatchNode.cpp:448–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void PatchNode::transformComponents(const Matrix4& matrix) {
449 // Are there any selected vertices?
450 if (selectedVertices())
451 {
452 // Set the iterator to the start of the (transformed) control points array
453 PatchControlIter ctrl = m_patch.getControlPointsTransformed().begin();
454
455 // Cycle through the patch control instances and transform the selected ones
456 // greebo: Have to investigate this further, why there are actually two iterators needed
457 for (PatchNode::PatchControlInstances::iterator i = m_ctrl_instances.begin();
458 i != m_ctrl_instances.end(); ++i, ++ctrl)
459 {
460 if (i->isSelected())
461 {
462 ctrl->vertex = matrix.transformPoint(ctrl->vertex);
463 }
464 }
465
466 // mark this patch transform as dirty
467 m_patch.transformChanged();
468 }
469
470 // Also, check if there are any drag planes selected
471 // this should only be true when the transform is a pure translation.
472 if (m_dragPlanes.isSelected())
473 {
474 m_patch.transform(m_dragPlanes.evaluateTransform(matrix.translation()));
475 }
476}
477
478void PatchNode::_onTransformationChanged()
479{

Callers

nothing calls this directly

Calls 8

translationMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
isSelectedMethod · 0.45
transformPointMethod · 0.45
transformChangedMethod · 0.45
transformMethod · 0.45
evaluateTransformMethod · 0.45

Tested by

no test coverage detected