|
|
|
@ -954,13 +954,17 @@ namespace NifOsg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Load the initial state of the particle system, i.e. the initial particles and their positions, velocity and colors.
|
|
|
|
|
void handleParticleInitialState(const Nif::Node* nifNode, osgParticle::ParticleSystem* partsys, const Nif::NiParticleSystemController* partctrl)
|
|
|
|
|
void handleParticleInitialState(const Nif::Node* nifNode, ParticleSystem* partsys, const Nif::NiParticleSystemController* partctrl)
|
|
|
|
|
{
|
|
|
|
|
auto particleNode = static_cast<const Nif::NiParticles*>(nifNode);
|
|
|
|
|
if (particleNode->data.empty() || particleNode->data->recType != Nif::RC_NiParticlesData)
|
|
|
|
|
{
|
|
|
|
|
partsys->setQuota(partctrl->numParticles);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto particledata = static_cast<const Nif::NiParticlesData*>(particleNode->data.getPtr());
|
|
|
|
|
partsys->setQuota(particledata->numParticles);
|
|
|
|
|
|
|
|
|
|
osg::BoundingBox box;
|
|
|
|
|
|
|
|
|
@ -1095,8 +1099,6 @@ namespace NifOsg
|
|
|
|
|
|
|
|
|
|
handleParticleInitialState(nifNode, partsys, partctrl);
|
|
|
|
|
|
|
|
|
|
partsys->setQuota(partctrl->numParticles);
|
|
|
|
|
|
|
|
|
|
partsys->getDefaultParticleTemplate().setSizeRange(osgParticle::rangef(partctrl->size, partctrl->size));
|
|
|
|
|
partsys->getDefaultParticleTemplate().setColorRange(osgParticle::rangev4(osg::Vec4f(1.f,1.f,1.f,1.f), osg::Vec4f(1.f,1.f,1.f,1.f)));
|
|
|
|
|
partsys->getDefaultParticleTemplate().setAlphaRange(osgParticle::rangef(1.f, 1.f));
|
|
|
|
|