osgEarth 2.1.1
Public Member Functions | Public Attributes

osgEarth::CullNodeByNormal Struct Reference

List of all members.

Public Member Functions

 CullNodeByNormal (const osg::Vec3d &normal)
void operator() (osg::Node *node, osg::NodeVisitor *nv)

Public Attributes

osg::Vec3d _normal

Detailed Description

A simple culling-plane callback (a simpler version of ClusterCullingCallback)

Definition at line 183 of file Utils.


Constructor & Destructor Documentation

CullNodeByNormal::CullNodeByNormal ( const osg::Vec3d &  normal)

Definition at line 68 of file Utils.cpp.

{
    _normal = normal;
    //_normal.normalize();
}

Member Function Documentation

void CullNodeByNormal::operator() ( osg::Node *  node,
osg::NodeVisitor *  nv 
)

Definition at line 75 of file Utils.cpp.

{
    osg::Vec3d eye, center, up;
    osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>( nv );

    cv->getCurrentCamera()->getViewMatrixAsLookAt(eye,center,up);

    eye.normalize();
    osg::Vec3d normal = _normal;
    normal.normalize();

    double dotProduct = eye * normal;
    if ( dotProduct > 0.0 )
    {
        traverse(node, nv);
    }
}

Member Data Documentation

Definition at line 184 of file Utils.


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