本文整理汇总了C++中ParticleSystem::_setMarkedForEmission方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleSystem::_setMarkedForEmission方法的具体用法?C++ ParticleSystem::_setMarkedForEmission怎么用?C++ ParticleSystem::_setMarkedForEmission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem::_setMarkedForEmission方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _increaseParticleSystemPool
//-----------------------------------------------------------------------
void ParticlePool::_increaseParticleSystemPool(size_t size,
Particle::ParticleBehaviourList& behaviours,
ParticleTechnique* technique)
{
size_t oldSize = mSystems.size();
if (size < oldSize)
return;
// Run through all emitters in the technique and check which one emits a particle system
size_t numberOfEmitters = technique->getNumEmitters();
if (numberOfEmitters == 0)
return;
ParticleSystem* system = 0;
ParticleSystem* clonedSystem = 0;
ParticleEmitter* emitter = 0;
size_t numberOfEmittedSystems = 0;
size_t systemCount = 0;
// First determine the number of emitted particle systems.
for (systemCount = 0; systemCount < numberOfEmitters; systemCount++)
{
emitter = technique->getEmitter(systemCount);
if (emitter->getEmitsType() == Particle::PT_SYSTEM)
{
numberOfEmittedSystems++;
}
}
if (numberOfEmittedSystems == 0)
return;
// Distribute size equally
size_t increment = (size-oldSize) / numberOfEmittedSystems;
// Fill the pool
for (systemCount = 0; systemCount < numberOfEmitters; systemCount++)
{
emitter = technique->getEmitter(systemCount);
if (emitter->getEmitsType() == Particle::PT_SYSTEM)
{
system = ParticleSystemManager::getSingletonPtr()->getParticleSystemTemplate(emitter->getEmitsName());
if (system)
{
// Create 'increment' ParticleSystems and add to the pool
std::stringstream ss;
ss << this;
for (size_t i = 0; i < increment; i++)
{
clonedSystem = ParticleSystemManager::getSingletonPtr()->createParticleSystem(
emitter->getEmitsName()+ ss.str() + StringConverter::toString(i),
emitter->getEmitsName(),
technique->getParentSystem()->getSceneManager());
clonedSystem->_setMarkedForEmission(true);
mParticleSystemPool.addElement(emitter->getEmitsName(), clonedSystem);
mSystems.push_back(clonedSystem->getName());
// Attach the Particle System to a SceneNode
Ogre::SceneNode* parentNode = technique->getParentSystem()->getParentSceneNode();
Ogre::SceneNode* node = parentNode->createChildSceneNode();
node->attachObject(clonedSystem);
node->setVisible(false);
}
}
}
}
}