本文整理汇总了C++中ParticleEmitter::setAlive方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEmitter::setAlive方法的具体用法?C++ ParticleEmitter::setAlive怎么用?C++ ParticleEmitter::setAlive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter::setAlive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cleanup
void ParticleSystemManager::cleanup()
{
for(unsigned int index = 0; index < m_aliveemitters.size(); index++)
{
ParticleEmitter* pe = m_aliveemitters.at(index);
pe->setAlive(false);
//delete pe;
}
m_aliveemitters.clear();
for(unsigned int index = 0; index < m_allemitters.size(); index++)
{
ParticleEmitter* pe = m_allemitters.at(index);
delete pe;
}
m_allemitters.clear();
}
示例2: onHit
void GunTurret::onHit()
{
if (m_active)
{
ParticleSystemManager& psm = getWriteableGameResource().getParticleSystemManager();
ParticleEmitter* pe = psm.createEmitter(m_center, Vector3::yAxis());
pe->setMaxParticles(250.0f);
pe->setEmissionRate(75.0f);
pe->setParticleStartColor(Color(1.0f, 1.0f, 1.0f, 1.0f));//Color(0.75f, 0.5f, 0.01f, 0.75f));
pe->setParticleKey1Color(Color(1.0f, 1.0f, 0.0f, 0.8f));
pe->setParticleKey1Pos(0.001f);
pe->setParticleKey2Color(Color(1.0f, 0.5f, 0.0f, 0.6f));
pe->setParticleKey2Pos(0.25f);
pe->setParticelEndColor(Color(0.0f, 0.0f, 0.0f, 0.0f));//Color(0.99f, 0.2f, 0.1f, 0.0f));
pe->setParticleLifetime(1.0f);
pe->setLifeTime(5.0f);
pe->setParticleSize(7.5f);
pe->setStartVelocity(10.0f);
pe->setSpreadAngle(180.0f);
pe->setAlive(true);
m_active = false;
}
}