osg::Vec3 w(zUpWind.y(), zUpWind.x(), -zUpWind.z());
wind = om.preMult(w);
- // SG_LOG(SG_GENERAL, SG_ALERT,
+ // SG_LOG(SG_PARTICLES, SG_ALERT,
// "wind vector:" << w[0] << "," <<w[1] << "," << w[2]);
}
{
if(!commonRoot.valid())
{
- SG_LOG(SG_GENERAL, SG_DEBUG, "Particle common root called!\n");
+ SG_LOG(SG_PARTICLES, SG_DEBUG, "Particle common root called.");
commonRoot = new osg::Group;
commonRoot.get()->setName("common particle system root");
commonGeode.get()->setName("common particle system geode");
const osgDB::Options*
options)
{
- SG_LOG(SG_GENERAL, SG_DEBUG, "Setting up a particle system!\n");
+ SG_LOG(SG_PARTICLES, SG_DEBUG,
+ "Setting up a particle system." << std::boolalpha
+ << "\n Name: " << configNode->getStringValue("name", "")
+ << "\n Type: " << configNode->getStringValue("type", "point")
+ << "\n Attach: " << configNode->getStringValue("attach", "")
+ << "\n Texture: " << configNode->getStringValue("texture", "")
+ << "\n Emissive: " << configNode->getBoolValue("emissive")
+ << "\n Lighting: " << configNode->getBoolValue("lighting")
+ << "\n Align: " << configNode->getStringValue("align", "")
+ << "\n Placer: " << configNode->hasChild("placer")
+ << "\n Shooter: " << configNode->hasChild("shooter")
+ << "\n Particle: " << configNode->hasChild("particle")
+ << "\n Program: " << configNode->hasChild("program")
+ << "\n Fluid: " << configNode->getChild("program")->getStringValue("fluid", "air")
+ << "\n Gravity: " << configNode->getChild("program")->getBoolValue("gravity", true)
+ << "\n Wind: " << configNode->getChild("program")->getBoolValue("wind", true)
+ << std::noboolalpha);
osgParticle::ParticleSystem *particleSys;
align->setName("particle align");
- //if (dynamic_cast<CustomModularEmitter*>(emitter)==0) SG_LOG(SG_GENERAL, SG_ALERT, "observer error\n");
+ //if (dynamic_cast<CustomModularEmitter*>(emitter)==0) SG_LOG(SG_PARTICLES, SG_ALERT, "observer error\n");
//align->addObserver(dynamic_cast<CustomModularEmitter*>(emitter));
align->addChild(emitter);
}
std::string textureFile;
if (configNode->hasValue("texture")) {
- //SG_LOG(SG_GENERAL, SG_ALERT,
+ //SG_LOG(SG_PARTICLES, SG_ALERT,
// "requested:"<<configNode->getStringValue("texture","")<<"\n");
textureFile= osgDB::findFileInPath(configNode->getStringValue("texture",
""),
options->getDatabasePathList());
- //SG_LOG(SG_GENERAL, SG_ALERT, "found:"<<textureFile<<"\n");
+ //SG_LOG(SG_PARTICLES, SG_ALERT, "found:"<<textureFile<<"\n");
//for(unsigned i = 0; i < options->getDatabasePathList().size(); ++i)
- // SG_LOG(SG_GENERAL, SG_ALERT,
+ // SG_LOG(SG_PARTICLES, SG_ALERT,
// "opts:"<<options->getDatabasePathList()[i]<<"\n");
}
}
emitter->setPlacer(msplacer);
} else {
- SG_LOG(SG_GENERAL, SG_ALERT,
+ SG_LOG(SG_PARTICLES, SG_ALERT,
"Detected particle system using segment(s) with less than 2 vertices\n");
}
} //else the default placer in ModularEmitter is used (PointPlacer)
}
if (callback.get()) { //this means we want property-driven changes
- SG_LOG(SG_GENERAL, SG_DEBUG, "setting up particle system user data and callback\n");
+ SG_LOG(SG_PARTICLES, SG_DEBUG, "Setting up particle system user data and callback.");
//setup data and callback
callback.get()->setGeneralData(dynamic_cast<osgParticle::RadialShooter*>(emitter->getShooter()),
dynamic_cast<osgParticle::RandomRateCounter*>(emitter->getCounter()),
void Particles::operator()(osg::Node* node, osg::NodeVisitor* nv)
{
- //SG_LOG(SG_GENERAL, SG_ALERT, "callback!\n");
+ //SG_LOG(SG_PARTICLES, SG_ALERT, "callback!\n");
this->particleSys->setFrozen(_frozen);
using namespace osg;