From 939522a214b59745591c0be8ab522e53de4c8d22 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 23 Feb 2011 13:56:41 +0000 Subject: [PATCH] Added support for negative --xMultipler, --yMultiple and --zMultiplier values --- examples/osgvolume/osgvolume.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 3afa492e7..d561f72e8 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -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());