mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
tightscenebound is uncessary after water bbfix
This commit is contained in:
parent
d42cb4f16d
commit
dc33eeadf1
8 changed files with 49 additions and 29 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue