Skip to content

Commit

Permalink
Fix #4792: Particle stages with "orientation x" had wrong rotation, c…
Browse files Browse the repository at this point in the history
…ausing textures to be flipped sideways
  • Loading branch information
codereader committed Nov 26, 2019
1 parent cb8f79b commit 3bfd63c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion radiant/particles/RenderableParticleStage.cpp
Expand Up @@ -110,7 +110,9 @@ void RenderableParticleStage::calculateStageViewRotation(const Matrix4& viewRota

case IStageDef::ORIENTATION_X:
// Rotate the z vector such that it faces the x axis, and use that as transform
_viewRotation = Matrix4::getRotation(Vector3(0,0,1), Vector3(1,0,0));
// To keep the up/down orientation of the material, rotate it 90 degrees around z
// before applying the z-to-x tilt (issue #4792)
_viewRotation = Matrix4::getRotation(Vector3(0,0,1), Vector3(1,0,0)).getMultipliedBy(Matrix4::getRotationAboutZDegrees(-90));
break;

case IStageDef::ORIENTATION_Y:
Expand Down

0 comments on commit 3bfd63c

Please sign in to comment.