mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 10:53:53 +00:00
Merge branch 'partcolor' into 'master'
Use NiParticleSystemController's color for the initially set particle color See merge request OpenMW/openmw!2234
This commit is contained in:
commit
49a15f72da
3 changed files with 5 additions and 5 deletions
|
@ -40,7 +40,7 @@ namespace Nif
|
||||||
horizontalDir = nif->getFloat();
|
horizontalDir = nif->getFloat();
|
||||||
horizontalAngle = nif->getFloat();
|
horizontalAngle = nif->getFloat();
|
||||||
/*normal?*/ nif->getVector3();
|
/*normal?*/ nif->getVector3();
|
||||||
/*color?*/ nif->getVector4();
|
color = nif->getVector4();
|
||||||
size = nif->getFloat();
|
size = nif->getFloat();
|
||||||
startTime = nif->getFloat();
|
startTime = nif->getFloat();
|
||||||
stopTime = nif->getFloat();
|
stopTime = nif->getFloat();
|
||||||
|
|
|
@ -52,6 +52,7 @@ struct NiParticleSystemController : public Controller
|
||||||
float horizontalDir;
|
float horizontalDir;
|
||||||
float horizontalAngle;
|
float horizontalAngle;
|
||||||
|
|
||||||
|
osg::Vec4f color;
|
||||||
float size;
|
float size;
|
||||||
float startTime;
|
float startTime;
|
||||||
float stopTime;
|
float stopTime;
|
||||||
|
|
|
@ -1050,9 +1050,8 @@ namespace NifOsg
|
||||||
const osg::Vec3f& position = particledata->vertices[particle.vertex];
|
const osg::Vec3f& position = particledata->vertices[particle.vertex];
|
||||||
created->setPosition(position);
|
created->setPosition(position);
|
||||||
|
|
||||||
osg::Vec4f partcolor (1.f,1.f,1.f,1.f);
|
created->setColorRange(osgParticle::rangev4(partctrl->color, partctrl->color));
|
||||||
if (particle.vertex < particledata->colors.size())
|
created->setAlphaRange(osgParticle::rangef(1.f, 1.f));
|
||||||
partcolor = particledata->colors[particle.vertex];
|
|
||||||
|
|
||||||
float size = partctrl->size;
|
float size = partctrl->size;
|
||||||
if (particle.vertex < particledata->sizes.size())
|
if (particle.vertex < particledata->sizes.size())
|
||||||
|
@ -1171,7 +1170,7 @@ namespace NifOsg
|
||||||
handleParticleInitialState(nifNode, partsys, partctrl);
|
handleParticleInitialState(nifNode, partsys, partctrl);
|
||||||
|
|
||||||
partsys->getDefaultParticleTemplate().setSizeRange(osgParticle::rangef(partctrl->size, partctrl->size));
|
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().setColorRange(osgParticle::rangev4(partctrl->color, partctrl->color));
|
||||||
partsys->getDefaultParticleTemplate().setAlphaRange(osgParticle::rangef(1.f, 1.f));
|
partsys->getDefaultParticleTemplate().setAlphaRange(osgParticle::rangef(1.f, 1.f));
|
||||||
|
|
||||||
if (!partctrl->emitter.empty())
|
if (!partctrl->emitter.empty())
|
||||||
|
|
Loading…
Reference in a new issue