Added / and * controls of the distance attentuations of the point size extension

This commit is contained in:
Robert Osfield 2005-06-27 14:28:29 +00:00
parent 4e0a5e5069
commit 92d15adf76

View File

@ -24,7 +24,7 @@ public:
{ {
_point = new osg::Point; _point = new osg::Point;
_point->setDistanceAttenuation(osg::Vec3(0.0,0.0005,0.0f)); _point->setDistanceAttenuation(osg::Vec3(0.0,0.0005,0.0f));
_point->setDistanceAttenuation(osg::Vec3(0.0,0.0000,0.000005f)); _point->setDistanceAttenuation(osg::Vec3(0.0,0.0000,0.05f));
_stateset->setAttribute(_point.get()); _stateset->setAttribute(_point.get());
} }
@ -44,6 +44,16 @@ public:
changePointSize(-1.0f); changePointSize(-1.0f);
return true; return true;
} }
else if (ea.getKey()=='*')
{
changePointAttenuation(1.1f);
return true;
}
else if (ea.getKey()=='/')
{
changePointAttenuation(1.0f/1.1f);
return true;
}
break; break;
} }
default: default:
@ -77,6 +87,11 @@ public:
setPointSize(getPointSize()+delta); setPointSize(getPointSize()+delta);
} }
void changePointAttenuation(float scale)
{
_point->setDistanceAttenuation(_point->getDistanceAttenuation()*scale);
}
osg::ref_ptr<osg::StateSet> _stateset; osg::ref_ptr<osg::StateSet> _stateset;
osg::ref_ptr<osg::Point> _point; osg::ref_ptr<osg::Point> _point;