forked from mirror/openmw-tes3mp
Account for UV coordinate flip in UVController (Fixes #3203)
This commit is contained in:
parent
6bfeb118d7
commit
be6ea3d607
1 changed files with 6 additions and 0 deletions
|
@ -254,9 +254,15 @@ void UVController::apply(osg::StateSet* stateset, osg::NodeVisitor* nv)
|
||||||
float uScale = mUScale.interpKey(value);
|
float uScale = mUScale.interpKey(value);
|
||||||
float vScale = mVScale.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);
|
osg::Matrixf mat = osg::Matrixf::scale(uScale, vScale, 1);
|
||||||
mat.setTrans(uTrans, vTrans, 0);
|
mat.setTrans(uTrans, vTrans, 0);
|
||||||
|
|
||||||
|
mat = flipMat * mat * flipMat;
|
||||||
|
|
||||||
// setting once is enough because all other texture units share the same TexMat (see setDefaults).
|
// setting once is enough because all other texture units share the same TexMat (see setDefaults).
|
||||||
if (!mTextureUnits.empty())
|
if (!mTextureUnits.empty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue