1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-04 02:41:19 +00:00

Account for UV coordinate flip in UVController (Fixes #3203)

This commit is contained in:
scrawl 2016-02-11 16:22:54 +01:00
parent 6bfeb118d7
commit be6ea3d607

View File

@ -254,9 +254,15 @@ void UVController::apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
float uScale = mUScale.interpKey(value);
float vScale = mVScale.interpKey(value);
osg::Matrix flipMat;
flipMat.preMultTranslate(osg::Vec3f(0,1,0));
flipMat.preMultScale(osg::Vec3f(1,-1,1));
osg::Matrixf mat = osg::Matrixf::scale(uScale, vScale, 1);
mat.setTrans(uTrans, vTrans, 0);
mat = flipMat * mat * flipMat;
// setting once is enough because all other texture units share the same TexMat (see setDefaults).
if (!mTextureUnits.empty())
{