Added support for positive values of --xMultiple <float> --yMultiplier <float> and --zMultiplier <float>

This commit is contained in:
Robert Osfield 2011-02-23 12:48:17 +00:00
parent a727b74926
commit 218f30b831

View File

@ -1080,18 +1080,19 @@ int main( int argc, char **argv )
float sliceEnd=1.0f;
while (arguments.read("--clip",sliceEnd)) { OSG_NOTICE<<"Warning: --clip option no longer supported."<<std::endl; invalidOption = true; }
float xMultiplier=1.0f;
while (arguments.read("--xMultiplier",xMultiplier)) { OSG_NOTICE<<"Warning: --xMultiplier option no longer supported."<<std::endl; invalidOption = true; }
float yMultiplier=1.0f;
while (arguments.read("--yMultiplier",yMultiplier)) { OSG_NOTICE<<"Warning: --yMultiplier option no longer supported."<<std::endl; invalidOption = true; }
float zMultiplier=1.0f;
while (arguments.read("--zMultiplier",zMultiplier)) { OSG_NOTICE<<"Warning: --zMultiplier option no longer supported."<<std::endl; invalidOption = true; }
if (invalidOption) return 1;
}
float xMultiplier=1.0f;
while (arguments.read("--xMultiplier",xMultiplier)) {}
float yMultiplier=1.0f;
while (arguments.read("--yMultiplier",yMultiplier)) {}
float zMultiplier=1.0f;
while (arguments.read("--zMultiplier",zMultiplier)) {}
float alphaFunc=0.02f;
while (arguments.read("--alphaFunc",alphaFunc)) {}
@ -1390,6 +1391,12 @@ int main( int argc, char **argv )
0.0, 0.0, 0.0, 1.0);
}
if (xMultiplier!=1.0 || yMultiplier!=1.0 || zMultiplier!=1.0)
{
matrix->postMultScale(osg::Vec3d(fabs(xMultiplier), fabs(yMultiplier), fabs(zMultiplier)));
}
osg::Vec4 minValue(FLT_MAX, FLT_MAX, FLT_MAX, FLT_MAX);
osg::Vec4 maxValue(-FLT_MAX, -FLT_MAX, -FLT_MAX, -FLT_MAX);
bool computeMinMax = false;