Add clamping to 0..1 bounds for each of the r,g,b,a components in

the CubeMapGenerator::set_pixel() method.
This commit is contained in:
Robert Osfield
2004-06-04 11:35:13 +00:00
parent c69a8a5b80
commit bfd1286b25
5 changed files with 129 additions and 126 deletions

View File

@@ -15,21 +15,21 @@
using namespace osgUtil;
HighlightMapGenerator::HighlightMapGenerator(const osg::Vec3 &light_direction,
const osg::Vec4 &light_color,
float specular_exponent,
int texture_size)
: CubeMapGenerator(texture_size),
ldir_(light_direction),
lcol_(light_color),
sexp_(specular_exponent)
const osg::Vec4 &light_color,
float specular_exponent,
int texture_size)
: CubeMapGenerator(texture_size),
ldir_(light_direction),
lcol_(light_color),
sexp_(specular_exponent)
{
ldir_.normalize();
ldir_.normalize();
}
HighlightMapGenerator::HighlightMapGenerator(const HighlightMapGenerator &copy, const osg::CopyOp &copyop)
: CubeMapGenerator(copy, copyop),
ldir_(copy.ldir_),
lcol_(copy.lcol_),
sexp_(copy.sexp_)
: CubeMapGenerator(copy, copyop),
ldir_(copy.ldir_),
lcol_(copy.lcol_),
sexp_(copy.sexp_)
{
}