Skip to content

Commit

Permalink
#5547: Refactor BrushNode::evaluateTransform() to save calculating th…
Browse files Browse the repository at this point in the history
…e transformation matrix if it's not going to be used.
  • Loading branch information
codereader committed Oct 8, 2021
1 parent 8ae96ba commit 5ffbf04
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions radiantcore/brush/BrushNode.cpp
Expand Up @@ -549,27 +549,24 @@ void BrushNode::evaluateTransform()
return;
}

Matrix4 matrix(calculateTransform());
//rMessage() << "matrix: " << matrix << "\n";

if (getType() == TRANSFORM_PRIMITIVE)
{
// If this is a pure translation (no other bits set), call the specialised method
if (getTransformationType() == Translation)
{
// TODO: Take care of texture lock
for (auto face : m_brush)
{
face->translate(getTranslation());
}
}
else
{
m_brush.transform(matrix);
m_brush.transform(calculateTransform());
}
}
else {
transformComponents(matrix);
else
{
transformComponents(calculateTransform());
}
}

Expand Down

0 comments on commit 5ffbf04

Please sign in to comment.