From Farshid Lasharki, added IO suppoty fo osgParticle::ConstantRateContour
This commit is contained in:
parent
fd76b4f87b
commit
7f731f330a
@ -116,6 +116,10 @@ SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_ConnectedParticleSystem.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_ConstantRateCounter.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osgParticle\IO_Emitter.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -7,6 +7,7 @@ CXXFILES =\
|
||||
IO_BoxPlacer.cpp\
|
||||
IO_CenteredPlacer.cpp\
|
||||
IO_ConnectedParticleSystem.cpp\
|
||||
IO_ConstantRateCounter.cpp\
|
||||
IO_Emitter.cpp\
|
||||
IO_FluidFrictionOperator.cpp\
|
||||
IO_ForceOperator.cpp\
|
||||
|
56
src/osgPlugins/osgParticle/IO_ConstantRateCounter.cpp
Normal file
56
src/osgPlugins/osgParticle/IO_ConstantRateCounter.cpp
Normal file
@ -0,0 +1,56 @@
|
||||
|
||||
#include <osgParticle/ConstantRateCounter>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <osgDB/Registry>
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
|
||||
bool ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr);
|
||||
bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw);
|
||||
|
||||
osgDB::RegisterDotOsgWrapperProxy ConstantRateCounter_Proxy
|
||||
(
|
||||
new osgParticle::ConstantRateCounter,
|
||||
"ConstantRateCounter",
|
||||
"Object Counter ConstantRateCounter",
|
||||
ConstantRateCounter_readLocalData,
|
||||
ConstantRateCounter_writeLocalData
|
||||
);
|
||||
|
||||
bool ConstantRateCounter_readLocalData(osg::Object &obj, osgDB::Input &fr)
|
||||
{
|
||||
osgParticle::ConstantRateCounter &myobj = static_cast<osgParticle::ConstantRateCounter &>(obj);
|
||||
bool itAdvanced = false;
|
||||
|
||||
if (fr[0].matchWord("minimumNumberOfParticlesToCreate")) {
|
||||
int v;
|
||||
if (fr[1].getInt(v)) {
|
||||
myobj.setMinimumNumberOfParticlesToCreate(v);
|
||||
fr += 2;
|
||||
itAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("numberOfParticlesPerSecondToCreate")) {
|
||||
float v;
|
||||
if (fr[1].getFloat(v)) {
|
||||
myobj.setNumberOfParticlesPerSecondToCreate(v);
|
||||
fr += 2;
|
||||
itAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
return itAdvanced;
|
||||
}
|
||||
|
||||
bool ConstantRateCounter_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
|
||||
{
|
||||
const osgParticle::ConstantRateCounter &myobj = static_cast<const osgParticle::ConstantRateCounter &>(obj);
|
||||
|
||||
fw.indent() << "minimumNumberOfParticlesToCreate " << myobj.getMinimumNumberOfParticlesToCreate() << std::endl;
|
||||
fw.indent() << "numberOfParticlesPerSecondToCreate " << myobj.getNumberOfParticlesPerSecondToCreate() << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Reference in New Issue
Block a user