//-----------------------------------------------------------------------
bool MaterialTab::isSelectedMaterialInUse()
{
	wxString materialName = mMaterialListBox->GetStringSelection();
	Ogre::String name = wx2ogre(materialName);
	ParticleUniverse::ParticleSystemManager* particleSystemManager = ParticleUniverse::ParticleSystemManager::getSingletonPtr();
	ParticleUniverse::vector<ParticleUniverse::String> names;
	particleSystemManager->particleSystemTemplateNames(names);
	ParticleUniverse::vector<ParticleUniverse::String>::iterator it;
	ParticleUniverse::vector<ParticleUniverse::String>::iterator itEnd = names.end();
	ParticleUniverse::ParticleSystem* pSys = 0;
	for (it = names.begin(); it != itEnd; ++it)
	{
		pSys = particleSystemManager->getParticleSystemTemplate(*it);
		if (pSys)
		{
			size_t numTechniques = pSys->getNumTechniques();
			for (size_t tech = 0; tech < numTechniques; ++tech)
			{
				ParticleUniverse::ParticleTechnique* particleTechnique = pSys->getTechnique(tech);
				if (particleTechnique)
				{
					if (particleTechnique->getMaterialName() == name)
					{
						return true;
					}
				}
			}
		}
	}
	return false;
}
예제 #2
0
	void CWeapon::update() {
		
		Ogre::Real time = OgreManager::getSingleton().getTimeSinceLastFrame();

		if(mTrail)
			mTrail->onUpdate(time);

		CRender* render = static_cast<CRender*>(getOwnerObject()->getComponent("CRender"));
		if(render) {
			ParticleUniverse::ParticleSystem* ps = ParticleManager::getSingleton().getParticle("door1_particle");
			ParticleUniverse::ParticleTechnique* tech = ps->getTechnique(0);
			ParticleUniverse::ParticleEmitter* emiter = tech->getEmitter(0);
			emiter->setParticleDirection( OgreManager::getSingleton().getCamera()->getDirection() ); //render->getNode()->_getDerivedOrientation() * Vector3::UNIT_Z
			//tech->getAffector(0)->
			
				//ParticleUniverse::

			//emiter->get

			//	ParticleUniverse::ParticleEmitter::set
		}


	}