diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 2c409ac96..b95eeebfc 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -749,6 +749,10 @@ namespace NifOsg created->setSizeRange(osgParticle::rangef(size, size)); } + + osg::BoundingBox box; + box.expandBy(osg::BoundingSphere(osg::Vec3(0,0,0), particledata->radius)); + partsys->setInitialBound(box); } static osg::ref_ptr handleParticleEmitter(const Nif::NiParticleSystemController* partctrl) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 8de08bd9d..bb4c57e4c 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace { @@ -61,6 +62,13 @@ namespace { partsys->getParticle(i)->transformPositionVelocity(worldMat); } + + // transform initial bounds to worldspace + osg::BoundingSphere sphere(partsys->getInitialBound()); + SceneUtil::transformBoundingSphere(worldMat, sphere); + osg::BoundingBox box; + box.expandBy(sphere); + partsys->setInitialBound(box); } };