mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-14 10:21:09 +00:00
Assign an initial bounding box to particle systems
This commit is contained in:
parent
b5099324d1
commit
8d6620b074
@ -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<Emitter> handleParticleEmitter(const Nif::NiParticleSystemController* partctrl)
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <components/vfs/manager.hpp>
|
||||
|
||||
#include <components/sceneutil/clone.hpp>
|
||||
#include <components/sceneutil/util.hpp>
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user