forked from teamnwah/openmw-tes3coop
Workaround for random AABB assertion due to zero-sized particles (Fixes #1663)
This commit is contained in:
parent
708dbc2518
commit
afc961d19c
2 changed files with 12 additions and 1 deletions
|
@ -973,7 +973,10 @@ class NIFObjectLoader
|
|||
{
|
||||
const Nif::NiParticleSystemController *partctrl = static_cast<const Nif::NiParticleSystemController*>(ctrl.getPtr());
|
||||
|
||||
partsys->setDefaultDimensions(partctrl->size*2, partctrl->size*2);
|
||||
float size = partctrl->size*2;
|
||||
// HACK: don't allow zero-sized particles which can rarely cause an AABB assertion in Ogre to fail
|
||||
size = std::max(size, 0.00001f);
|
||||
partsys->setDefaultDimensions(size, size);
|
||||
|
||||
if(!partctrl->emitter.empty())
|
||||
{
|
||||
|
|
|
@ -452,6 +452,8 @@ public:
|
|||
{
|
||||
Ogre::Real scale = (life_time-particle_time) / mGrowTime;
|
||||
assert (scale >= 0);
|
||||
// HACK: don't allow zero-sized particles which can rarely cause an AABB assertion in Ogre to fail
|
||||
scale = std::max(scale, 0.00001f);
|
||||
width *= scale;
|
||||
height *= scale;
|
||||
}
|
||||
|
@ -459,6 +461,8 @@ public:
|
|||
{
|
||||
Ogre::Real scale = particle_time / mFadeTime;
|
||||
assert (scale >= 0);
|
||||
// HACK: don't allow zero-sized particles which can rarely cause an AABB assertion in Ogre to fail
|
||||
scale = std::max(scale, 0.00001f);
|
||||
width *= scale;
|
||||
height *= scale;
|
||||
}
|
||||
|
@ -485,6 +489,8 @@ public:
|
|||
{
|
||||
Ogre::Real scale = (life_time-particle_time) / mGrowTime;
|
||||
assert (scale >= 0);
|
||||
// HACK: don't allow zero-sized particles which can rarely cause an AABB assertion in Ogre to fail
|
||||
scale = std::max(scale, 0.00001f);
|
||||
width *= scale;
|
||||
height *= scale;
|
||||
}
|
||||
|
@ -492,6 +498,8 @@ public:
|
|||
{
|
||||
Ogre::Real scale = particle_time / mFadeTime;
|
||||
assert (scale >= 0);
|
||||
// HACK: don't allow zero-sized particles which can rarely cause an AABB assertion in Ogre to fail
|
||||
scale = std::max(scale, 0.00001f);
|
||||
width *= scale;
|
||||
height *= scale;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue