Added osg::CoordinateSystemNode

This commit is contained in:
Robert Osfield
2004-04-29 22:16:50 +00:00
parent df0d0b0fe7
commit 36cd372847
5 changed files with 315 additions and 1 deletions

View File

@@ -1093,6 +1093,11 @@ void ClusterCullingCallback::computeFrom(const osg::Drawable* drawable)
TriangleFunctor<ComputeDeviationFunctor> cdf;
cdf.set(_controlPoint,_normal);
drawable->accept(cdf);
// osg::notify(osg::NOTICE)<<"ClusterCullingCallback::computeFrom() _controlPoint="<<_controlPoint<<std::endl;
// osg::notify(osg::NOTICE)<<" _normal="<<_normal<<std::endl;
// osg::notify(osg::NOTICE)<<" cdf._deviation="<<cdf._deviation<<std::endl;
if (_normal.length2()==0.0) _deviation = -1.0f;
else
@@ -1115,11 +1120,18 @@ void ClusterCullingCallback::set(const osg::Vec3& controlPoint, const osg::Vec3&
bool ClusterCullingCallback::cull(osg::NodeVisitor* nv, osg::Drawable* , osg::State*) const
{
if (_deviation<=-1.0f) return false;
if (_deviation<=-1.0f)
{
// osg::notify(osg::NOTICE)<<"ClusterCullingCallback::cull() _deviation="<<_deviation<<std::endl;
return false;
}
osg::Vec3 eye_cp = nv->getEyePoint() - _controlPoint;
float deviation = (eye_cp * _normal)/eye_cp.length();
// osg::notify(osg::NOTICE)<<"ClusterCullingCallback::cull() _normal="<<_normal<<" _controlPointtest="<<_controlPoint<<" eye_cp="<<eye_cp<<std::endl;
// osg::notify(osg::NOTICE)<<" deviation="<<deviation<<" _deviation="<<_deviation<<" test="<<(deviation < _deviation)<<std::endl;
return deviation < _deviation;
}