Skip to content

Commit

Permalink
#5773: Add complement TextureProjection::getShiftScaleRotation(), to …
Browse files Browse the repository at this point in the history
…avoid having to access the inner TextureMatrix.
  • Loading branch information
codereader committed Oct 9, 2021
1 parent 35be717 commit d1ce07f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion radiantcore/brush/Face.cpp
Expand Up @@ -465,7 +465,7 @@ void Face::SetTexdef(const TextureProjection& projection)

ShiftScaleRotation Face::getShiftScaleRotation() const
{
auto ssr = _texdef.getTextureMatrix().getShiftScaleRotation();
auto ssr = _texdef.getShiftScaleRotation();

// These values are going to show up in the Surface Inspector, so
// we need to make some adjustments:
Expand Down
5 changes: 5 additions & 0 deletions radiantcore/brush/TextureProjection.cpp
Expand Up @@ -66,6 +66,11 @@ void TextureProjection::setTransformFromMatrix4(const Matrix4& transform)
setTransform(getTextureMatrixFromMatrix4(transform));
}

ShiftScaleRotation TextureProjection::getShiftScaleRotation() const
{
return _matrix.getShiftScaleRotation();
}

void TextureProjection::setFromShiftScaleRotate(const ShiftScaleRotation& ssr)
{
_matrix = TextureMatrix(ssr);
Expand Down
2 changes: 2 additions & 0 deletions radiantcore/brush/TextureProjection.h
Expand Up @@ -41,6 +41,8 @@ class TextureProjection final
TextureProjection& operator=(const TextureProjection& other);

void setTransform(const Matrix3& transform);

ShiftScaleRotation getShiftScaleRotation() const;
void setFromShiftScaleRotate(const ShiftScaleRotation& ssr);

Matrix3 getMatrix() const;
Expand Down

0 comments on commit d1ce07f

Please sign in to comment.