osgEarth 2.1.1
Public Member Functions

anonymous_namespace{NodeUtils.cpp}::MyClusterCullingCallback Struct Reference

List of all members.

Public Member Functions

bool cull (osg::NodeVisitor *nv, osg::Drawable *, osg::State *) const

Detailed Description

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.


Member Function Documentation

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;
        }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines