diff --git a/simgear/scene/tgdb/SGOceanTile.cxx b/simgear/scene/tgdb/SGOceanTile.cxx index 29839b29..7292a588 100644 --- a/simgear/scene/tgdb/SGOceanTile.cxx +++ b/simgear/scene/tgdb/SGOceanTile.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -340,5 +341,10 @@ osg::Node* SGOceanTile(const SGBucket& b, SGMaterialLib *matlib, int latPoints, transform->addChild(geode); transform->setNodeMask( ~(simgear::CASTSHADOW_BIT | simgear::MODELLIGHT_BIT) ); + // Create a BVH at this point. This is normally provided by the file loader, but as we create the + // geometry programmatically, no file loader is involved. + BoundingVolumeBuildVisitor bvhBuilder(false); + transform->accept(bvhBuilder); + return transform; }