tightscenebound is uncessary after water bbfix

This commit is contained in:
bzzt 2019-06-21 13:37:00 +00:00 committed by Bret Curtis
parent d42cb4f16d
commit dc33eeadf1
8 changed files with 49 additions and 29 deletions

View file

@ -7,6 +7,12 @@
namespace SceneUtil
{
// disable nonsense test against a worldsize bb what will always pass
class WaterBoundCallback : public osg::Drawable::ComputeBoundingBoxCallback
{
virtual osg::BoundingBox computeBound(const osg::Drawable&) const { return osg::BoundingBox(); }
};
osg::ref_ptr<osg::Geometry> createWaterGeometry(float size, int segments, float textureRepeats)
{
osg::ref_ptr<osg::Vec3Array> verts (new osg::Vec3Array);
@ -51,6 +57,8 @@ namespace SceneUtil
waterGeom->setNormalArray(normal, osg::Array::BIND_OVERALL);
waterGeom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,verts->size()));
waterGeom->setComputeBoundingBoxCallback(new WaterBoundCallback);
waterGeom->setCullingActive(false);
return waterGeom;
}