root/OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osgParticle/IO_VariableRateCounter.cpp @ 13041

Revision 13041, 1.3 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2#include <osgParticle/VariableRateCounter>
3
4#include <iostream>
5
6#include <osgDB/Registry>
7#include <osgDB/Input>
8#include <osgDB/Output>
9
10bool  VariableRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr);
11bool  VariableRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
12
13REGISTER_DOTOSGWRAPPER(VariableRateCounter_Proxy)
14(
15    0,
16    "VariableRateCounter",
17    "Object Counter VariableRateCounter",
18    VariableRateCounter_readLocalData,
19    VariableRateCounter_writeLocalData
20);
21
22bool VariableRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr)
23{
24    osgParticle::VariableRateCounter &myobj = static_cast<osgParticle::VariableRateCounter &>(obj);
25    bool itAdvanced = false;
26
27    osgParticle::rangef r;
28    if (fr[0].matchWord("rateRange")) {
29        if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
30            myobj.setRateRange(r);
31            fr += 3;
32            itAdvanced = true;
33        }
34    }
35
36    return itAdvanced;
37}
38
39bool VariableRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
40{
41    const osgParticle::VariableRateCounter &myobj = static_cast<const osgParticle::VariableRateCounter &>(obj);
42
43    osgParticle::rangef r = myobj.getRateRange();
44    fw.indent() << "rateRange " << r.minimum << " " << r.maximum << std::endl;
45
46    return true;
47}
Note: See TracBrowser for help on using the browser.