2002-06-05 20:44:55 +08:00
|
|
|
|
|
|
|
#include <osgParticle/RadialShooter>
|
|
|
|
#include <osgParticle/range>
|
|
|
|
|
|
|
|
#include <osgDB/Registry>
|
|
|
|
#include <osgDB/Input>
|
|
|
|
#include <osgDB/Output>
|
|
|
|
|
|
|
|
bool RadialShooter_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
|
|
|
bool RadialShooter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
|
|
|
|
|
|
|
osgDB::RegisterDotOsgWrapperProxy RadialShooter_Proxy
|
|
|
|
(
|
2002-12-16 21:40:58 +08:00
|
|
|
new osgParticle::RadialShooter,
|
2002-06-05 20:44:55 +08:00
|
|
|
"RadialShooter",
|
|
|
|
"Object Shooter RadialShooter",
|
|
|
|
RadialShooter_readLocalData,
|
|
|
|
RadialShooter_writeLocalData
|
|
|
|
);
|
|
|
|
|
|
|
|
bool RadialShooter_readLocalData(osg::Object &obj, osgDB::Input &fr)
|
|
|
|
{
|
|
|
|
osgParticle::RadialShooter &myobj = static_cast<osgParticle::RadialShooter &>(obj);
|
|
|
|
bool itAdvanced = false;
|
|
|
|
|
|
|
|
osgParticle::rangef r;
|
|
|
|
|
|
|
|
if (fr[0].matchWord("thetaRange")) {
|
2002-08-04 02:03:40 +08:00
|
|
|
if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
|
2002-06-05 20:44:55 +08:00
|
|
|
myobj.setThetaRange(r);
|
|
|
|
fr += 3;
|
|
|
|
itAdvanced = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fr[0].matchWord("phiRange")) {
|
2002-08-04 02:03:40 +08:00
|
|
|
if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
|
2002-06-05 20:44:55 +08:00
|
|
|
myobj.setPhiRange(r);
|
|
|
|
fr += 3;
|
|
|
|
itAdvanced = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fr[0].matchWord("initialSpeedRange")) {
|
2002-08-04 02:03:40 +08:00
|
|
|
if (fr[1].getFloat(r.minimum) && fr[2].getFloat(r.maximum)) {
|
2002-06-05 20:44:55 +08:00
|
|
|
myobj.setInitialSpeedRange(r);
|
|
|
|
fr += 3;
|
|
|
|
itAdvanced = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return itAdvanced;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RadialShooter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
|
|
|
|
{
|
|
|
|
const osgParticle::RadialShooter &myobj = static_cast<const osgParticle::RadialShooter &>(obj);
|
|
|
|
osgParticle::rangef r;
|
|
|
|
|
|
|
|
r = myobj.getThetaRange();
|
2002-08-04 02:03:40 +08:00
|
|
|
fw.indent() << "thetaRange " << r.minimum << " " << r.maximum << std::endl;
|
2002-06-05 20:44:55 +08:00
|
|
|
r = myobj.getPhiRange();
|
2002-08-04 02:03:40 +08:00
|
|
|
fw.indent() << "phiRange " << r.minimum << " " << r.maximum << std::endl;
|
2002-06-05 20:44:55 +08:00
|
|
|
r = myobj.getInitialSpeedRange();
|
2002-08-04 02:03:40 +08:00
|
|
|
fw.indent() << "initialSpeedRange " << r.minimum << " " << r.maximum << std::endl;
|
2002-06-05 20:44:55 +08:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|