|
Revision 11020, 1.0 kB
(checked in by robert, 3 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 | |
|---|
| 6 | static bool checkRateRange( const osgParticle::VariableRateCounter& obj ) |
|---|
| 7 | { return true; } |
|---|
| 8 | |
|---|
| 9 | static 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 | |
|---|
| 15 | static 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 | |
|---|
| 22 | REGISTER_OBJECT_WRAPPER( osgParticleVariableRateCounter, |
|---|
| 23 | NULL, |
|---|
| 24 | osgParticle::VariableRateCounter, |
|---|
| 25 | "osg::Object osgParticle::Counter osgParticle::VariableRateCounter" ) |
|---|
| 26 | { |
|---|
| 27 | ADD_USER_SERIALIZER( RateRange ); |
|---|
| 28 | } |
|---|