Added / and * controls of the distance attentuations of the point size extension
This commit is contained in:
parent
4e0a5e5069
commit
92d15adf76
@ -24,7 +24,7 @@ public:
|
||||
{
|
||||
_point = new osg::Point;
|
||||
_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());
|
||||
}
|
||||
|
||||
@ -44,6 +44,16 @@ public:
|
||||
changePointSize(-1.0f);
|
||||
return true;
|
||||
}
|
||||
else if (ea.getKey()=='*')
|
||||
{
|
||||
changePointAttenuation(1.1f);
|
||||
return true;
|
||||
}
|
||||
else if (ea.getKey()=='/')
|
||||
{
|
||||
changePointAttenuation(1.0f/1.1f);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -77,6 +87,11 @@ public:
|
||||
setPointSize(getPointSize()+delta);
|
||||
}
|
||||
|
||||
void changePointAttenuation(float scale)
|
||||
{
|
||||
_point->setDistanceAttenuation(_point->getDistanceAttenuation()*scale);
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::StateSet> _stateset;
|
||||
osg::ref_ptr<osg::Point> _point;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user