List of all members.
Public Member Functions |
| CullNodeByHorizon (const osg::Vec3d &world, const osg::EllipsoidModel *model) |
void | operator() (osg::Node *node, osg::NodeVisitor *nv) |
Public Attributes |
osg::Vec3d | _world |
double | _r2 |
Detailed Description
Definition at line 197 of file Utils.
Constructor & Destructor Documentation
CullNodeByHorizon::CullNodeByHorizon |
( |
const osg::Vec3d & |
world, |
|
|
const osg::EllipsoidModel * |
model |
|
) |
| |
Definition at line 38 of file Utils.cpp.
:
_world(world),
_r2(model->getRadiusPolar() * model->getRadiusPolar())
{
}
Member Function Documentation
void CullNodeByHorizon::operator() |
( |
osg::Node * |
node, |
|
|
osg::NodeVisitor * |
nv |
|
) |
| |
Definition at line 46 of file Utils.cpp.
{
if ( nv )
{
osg::Vec3d eye, center, up;
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>( nv );
cv->getCurrentCamera()->getViewMatrixAsLookAt(eye,center,up);
double d2 = eye.length2();
double horiz2 = d2 - _r2;
double dist2 = (_world-eye).length2();
if ( dist2 < horiz2 )
{
traverse(node, nv);
}
}
}
Member Data Documentation
The documentation for this struct was generated from the following files:
- /home/cube/sources/osgearth/src/osgEarth/Utils
- /home/cube/sources/osgearth/src/osgEarth/Utils.cpp