osgEarth 2.1.1
Static Public Member Functions

osgEarth::ClusterCullerFactory Struct Reference

List of all members.

Static Public Member Functions

static
osg::ClusterCullingCallback * 
create (osg::Node *node, const osg::Vec3d &centerGeocentric)

Detailed Description

Given a geocentric subgraph and a center point, generate a suitable cluster culling callback.

Definition at line 31 of file NodeUtils.


Member Function Documentation

osg::ClusterCullingCallback * ClusterCullerFactory::create ( osg::Node *  node,
const osg::Vec3d &  centerGeocentric 
) [static]

Definition at line 237 of file NodeUtils.cpp.

{
    // Cluster culling computer. This works in two passes.
    //
    // It starts with a control point provided by the caller. I the first pass it computes
    // a new control point that is along the same geocentric normal but at a lower Z. This 
    // corresponds to the lowest Z of a vertex with respect to that normal. This means we
    // can always use a "deviation" of 0 -- and it gets around the problem of the control
    // point being higher than a vertex and corrupting the deviation.
    //
    // In the second pass, we compute the radius based on the new control point.

    osg::ClusterCullingCallback* ccc = 0L;
    if ( node )
    {
        ComputeVisitor cv;
        cv.run( node, centerECEF );

        ccc = new MyClusterCullingCallback(); //osg::ClusterCullingCallback();
        ccc->set( cv._centerECEF, cv._normalECEF, 0.0f, sqrt(cv._maxRadius2) );
    }
    return ccc;
}

Here is the caller graph for this function:


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