Ported distribution across to use the new osg::MatrixTransform and osg::BlendFunc

class instead of osg::Transform and osg::Transparancy respectively.
This commit is contained in:
Robert Osfield
2002-07-12 18:12:01 +00:00
parent 8128265e09
commit 6f392cdbfa
32 changed files with 93 additions and 97 deletions

View File

@@ -9,7 +9,7 @@
#include <osg/GL>
#include <osg/StateSet>
#include <osg/Texture>
#include <osg/Transparency>
#include <osg/BlendFunc>
#include <osg/TexEnv>
#include <osg/Material>
@@ -161,13 +161,13 @@ void osgParticle::ParticleSystem::setDefaultAttributes(const std::string &textur
stateset->setTextureAttribute(texture_unit, texenv);
}
osg::Transparency *transparency = osgNew osg::Transparency;
osg::BlendFunc *blend = osgNew osg::BlendFunc;
if (emissive_particles) {
transparency->setFunction(osg::Transparency::SRC_ALPHA, osg::Transparency::ONE);
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE);
} else {
transparency->setFunction(osg::Transparency::SRC_ALPHA, osg::Transparency::ONE_MINUS_SRC_ALPHA);
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
}
stateset->setAttributeAndModes(transparency, osg::StateAttribute::ON);
stateset->setAttributeAndModes(blend, osg::StateAttribute::ON);
setStateSet(stateset);
}