|
osgEarth 2.1.1
|
Public Member Functions | |
| bool | cull (osg::NodeVisitor *nv, osg::Drawable *, osg::State *) const |
A customized CCC that works correctly under an RTT camera. The built-in one called getEyePoint() instead of getViewPoint() and therefore isn't compatible with osg::Camera::ABSOLUTE_RF_INHERIT_VIEWPOINT mode.
Definition at line 204 of file NodeUtils.cpp.
| bool anonymous_namespace{NodeUtils.cpp}::MyClusterCullingCallback::cull | ( | osg::NodeVisitor * | nv, |
| osg::Drawable * | , | ||
| osg::State * | |||
| ) | const [inline] |
Definition at line 206 of file NodeUtils.cpp.
{
osg::CullSettings* cs = dynamic_cast<osg::CullSettings*>(nv);
if (cs && !(cs->getCullingMode() & osg::CullSettings::CLUSTER_CULLING))
{
return false;
}
if (_deviation<=-1.0f)
{
return false;
}
osg::Vec3 eye_cp = nv->getViewPoint() - _controlPoint;
float radius = eye_cp.length();
if (radius<_radius)
{
return false;
}
float deviation = (eye_cp * _normal)/radius;
return deviation < _deviation;
}
1.7.3