Added CLUSTER_CULLING mask to CullSettings, and modified the ClusterCullingCallback

to use the mask to see if cluster culling is enabled or disabled.
This commit is contained in:
Robert Osfield
2004-07-11 21:46:23 +00:00
parent c7647b98b8
commit 363d13d7ce
2 changed files with 14 additions and 5 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osg/ClusterCullingCallback>
#include <osg/TriangleFunctor>
#include <osg/CullSettings>
using namespace osg;
@@ -145,11 +146,16 @@ void ClusterCullingCallback::set(const osg::Vec3& controlPoint, const osg::Vec3&
bool ClusterCullingCallback::cull(osg::NodeVisitor* nv, osg::Drawable* , osg::State*) const
{
// return false;
CullSettings* cs = dynamic_cast<CullSettings*>(nv);
if (cs && !(cs->getCullingMode() & CullSettings::CLUSTER_CULLING))
{
// cluster culling switched off cull settings.
return false;
}
if (_deviation<=-1.0f)
{
// osg::notify(osg::NOTICE)<<"ClusterCullingCallback::cull() _deviation="<<_deviation<<std::endl;
// cluster culling switch off by deviation.
return false;
}