From Wang Rui, added osgParticle serializers

This commit is contained in:
Robert Osfield
2010-01-28 08:53:48 +00:00
parent 13531757c4
commit db275d7c26
38 changed files with 855 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include <osgParticle/VariableRateCounter>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
static bool checkRateRange( const osgParticle::VariableRateCounter& obj )
{ return true; }
static bool readRateRange( osgDB::InputStream& is, osgParticle::VariableRateCounter& obj )
{
float min, max; is >> min >> max;
obj.setRateRange( min, max ); return true;
}
static bool writeRateRange( osgDB::OutputStream& os, const osgParticle::VariableRateCounter& obj )
{
const osgParticle::rangef& range = obj.getRateRange();
os << range.minimum << range.maximum << std::endl;
return true;
}
REGISTER_OBJECT_WRAPPER( osgParticleVariableRateCounter,
/*new osgParticle::VariableRateCounter*/NULL,
osgParticle::VariableRateCounter,
"osg::Object osgParticle::Counter osgParticle::VariableRateCounter" )
{
ADD_USER_SERIALIZER( RateRange ); // _rate_range
}