Added support for negative --xMultipler, --yMultiple and --zMultiplier values

This commit is contained in:
Robert Osfield 2011-02-23 13:56:41 +00:00
parent 218f30b831
commit 939522a214

View File

@ -1550,7 +1550,18 @@ int main( int argc, char **argv )
}
};
layer->setLocator(new osgVolume::Locator(*matrix));
if (xMultiplier<0.0 || yMultiplier<0.0 || zMultiplier<0.0)
{
layer->setLocator(new osgVolume::Locator(
osg::Matrix::translate(xMultiplier<0.0 ? -1.0 : 0.0, yMultiplier<0.0 ? -1.0 : 0.0, zMultiplier<0.0 ? -1.0 : 0.0) *
osg::Matrix::scale(xMultiplier<0.0 ? -1.0 : 1.0, yMultiplier<0.0 ? -1.0 : 1.0, zMultiplier<0.0 ? -1.0 : 1.0) *
(*matrix)
));;
}
else
{
layer->setLocator(new osgVolume::Locator(*matrix));
}
tile->setLocator(new osgVolume::Locator(*matrix));
tile->setLayer(layer.get());