Fixed cluster culling.

This commit is contained in:
Robert Osfield
2004-07-09 20:58:43 +00:00
parent a7490a2ea2
commit 3f4b8e9034
3 changed files with 13 additions and 5 deletions

View File

@@ -2173,6 +2173,7 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
float min_dot_product = 1.0f;
float max_cluster_culling_height = 0.0f;
float max_cluster_culling_radius = 0.0f;
for(r=0;r<numRows;++r)
{
@@ -2215,6 +2216,7 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
float local_m = globe_radius*( 1.0/ cos(theta+phi) - 1.0);
min_dot_product = osg::minimum(min_dot_product, local_dot_product);
max_cluster_culling_height = osg::maximum(max_cluster_culling_height,local_m);
max_cluster_culling_radius = osg::maximum(max_cluster_culling_radius,static_cast<float>(beta*globe_radius));
}
else
{
@@ -2305,7 +2307,8 @@ osg::Node* DataSet::DestinationTile::createPolygonal()
ccc->set(center_position + transformed_center_normal*max_cluster_culling_height ,
transformed_center_normal,
min_dot_product);
min_dot_product,
max_cluster_culling_radius);
geometry->setCullCallback(ccc);
}