Browse Source

Merge pull request #1435 from Azaezel/alpha41/rotationRot

fix (?) rotation
Brian Roberts 6 months ago
parent
commit
68f44c1596
1 changed files with 7 additions and 9 deletions
  1. 7 9
      Engine/source/materials/processedShaderMaterial.cpp

+ 7 - 9
Engine/source/materials/processedShaderMaterial.cpp

@@ -942,20 +942,18 @@ void ProcessedShaderMaterial::_setTextureTransforms(const U32 pass)
          ? waveOffset * M_2PI
          : mMaterial->mRotPos[pass];
 
-      MatrixF rotationMat(EulerF(0.0f, 0.0f, rotationAngle));
-
       Point3F pivotPoint(
          mMaterial->mRotPivotOffset[pass].x,
          mMaterial->mRotPivotOffset[pass].y,
          0.0f);
-
-      MatrixF finalRotationMat(true);
-      finalRotationMat.setColumn(3, pivotPoint);
-      finalRotationMat.mul(rotationMat);
-      finalRotationMat.setColumn(3, -pivotPoint);
-
+      
+      MatrixF rotationMat = MatrixF(EulerF(0.0, 0.0, rotationAngle), Point3F(0.5, 0.5, 0.0));
+      MatrixF test(true);
+      test.setColumn(3, pivotPoint);
+      rotationMat.mul(test);
+      rotationMat.displace(texMat.getPosition());
       // Apply final rotation matrix
-      texMat.mul(finalRotationMat);
+      texMat = rotationMat;
    }
 
    // --- Scale Animation ---