root/OpenSceneGraph/trunk/src/osgWrappers/serializers/osgParticle/VariableRateCounter.cpp @ 11020

Revision 11020, 1.0 kB (checked in by robert, 4 years ago)

From Wang Rui, added osgParticle serializers

Line 
1#include <osgParticle/VariableRateCounter>
2#include <osgDB/ObjectWrapper>
3#include <osgDB/InputStream>
4#include <osgDB/OutputStream>
5
6static bool checkRateRange( const osgParticle::VariableRateCounter& obj )
7{ return true; }
8
9static bool readRateRange( osgDB::InputStream& is, osgParticle::VariableRateCounter& obj )
10{
11    float min, max; is >> min >> max;
12    obj.setRateRange( min, max ); return true;
13}
14
15static bool writeRateRange( osgDB::OutputStream& os, const osgParticle::VariableRateCounter& obj )
16{
17    const osgParticle::rangef& range = obj.getRateRange();
18    os << range.minimum << range.maximum << std::endl;
19    return true;
20}
21
22REGISTER_OBJECT_WRAPPER( osgParticleVariableRateCounter,
23                         /*new osgParticle::VariableRateCounter*/NULL,
24                         osgParticle::VariableRateCounter,
25                         "osg::Object osgParticle::Counter osgParticle::VariableRateCounter" )
26{
27    ADD_USER_SERIALIZER( RateRange );  // _rate_range
28}
Note: See TracBrowser for help on using the browser.