本文整理汇总了C++中ParticleEmitter::Stop方法的典型用法代码示例。如果您正苦于以下问题:C++ ParticleEmitter::Stop方法的具体用法?C++ ParticleEmitter::Stop怎么用?C++ ParticleEmitter::Stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParticleEmitter
的用法示例。
在下文中一共展示了ParticleEmitter::Stop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Stop
void ParticleEffectComponent::Stop()
{
int32 childrenCount = entity->GetChildrenCount();
for (int32 i = 0; i < childrenCount; i ++)
{
RenderComponent * component = static_cast<RenderComponent*>(entity->GetChild(i)->GetComponent(Component::RENDER_COMPONENT));
if(component && component->GetRenderObject() && component->GetRenderObject()->GetType() == RenderObject::TYPE_PARTICLE_EMTITTER)
{
ParticleEmitter * emitter = static_cast<ParticleEmitter*>(component->GetRenderObject());
emitter->Stop();
}
emittersCurrentlyStopped++;
}
}
示例2: EffectUpdate
void ParticleEffectComponent::EffectUpdate(float32 timeElapsed)
{
int32 childrenCount = entity->GetChildrenCount();
for (int32 i = 0; i < childrenCount; i ++)
{
RenderComponent * component = static_cast<RenderComponent*>(entity->GetChild(i)->GetComponent(Component::RENDER_COMPONENT));
if(component && component->GetRenderObject() && component->GetRenderObject()->GetType() == RenderObject::TYPE_PARTICLE_EMTITTER)
{
ParticleEmitter * emitter = static_cast<ParticleEmitter*>(component->GetRenderObject());
if (IsStopEmitter(emitter))
{
emitter->Stop();
this->emittersCurrentlyStopped++;
// Are all the emitters finished playback? Notify user if yes.
CheckPlaybackComplete();
}
}
}
}
示例3: DEBUGMSG
RESULT
ParticleManager::Update( UINT64 elapsedMS )
{
RESULT rval = S_OK;
//
// TODO: if our update frequency is less than 60Hz, we should
// spread out the emitter updates, rather than updating ALL of them
// every fourth frame (for example).
//
static UINT64 lastUpdateTimeMS = 0;
if ((elapsedMS - lastUpdateTimeMS) < m_updateIntervalMS)
{
return S_OK;
}
lastUpdateTimeMS = elapsedMS;
// Release ParticleEmitters that were marked as done on previous frame.
ParticleEmitterListIterator ppParticleEmitter;
for (ppParticleEmitter = m_pendingReleaseParticleEmittersList.begin(); ppParticleEmitter != m_pendingReleaseParticleEmittersList.end(); ++ppParticleEmitter)
{
ParticleEmitter* pParticleEmitter = *ppParticleEmitter;
if (!pParticleEmitter)
continue;
DEBUGMSG(ZONE_PARTICLES, "Releasing ParticleEmitter [%s], refCount = %d", pParticleEmitter->GetName().c_str(), pParticleEmitter->GetRefCount());
//pParticleEmitter->Stop();
CHR(Release( pParticleEmitter ));
}
m_pendingReleaseParticleEmittersList.clear();
// Update every running ParticleEmitter.
for (ppParticleEmitter = m_runningParticleEmittersList.begin(); ppParticleEmitter != m_runningParticleEmittersList.end(); /*++ppParticleEmitter*/)
{
ParticleEmitter* pParticleEmitter = *ppParticleEmitter;
if (!pParticleEmitter)
{
ppParticleEmitter = m_runningParticleEmittersList.erase( ppParticleEmitter );
continue;
}
// if (Log::IsZoneEnabled(ZONE_PARTICLES | ZONE_VERBOSE))
// {
// char str[1024];
// sprintf(str, "PE: %s", pParticleEmitter->GetName().c_str());
// DebugRender.Text(str, Color::White(), 1.0f, 1.0f);
// }
if (FAILED(pParticleEmitter->Update( elapsedMS )))
{
pParticleEmitter->Stop();
//
// NOTE: if you erase a list member while iterating the list,
// be sure to properly increment the iterator as seen below.
//
ppParticleEmitter = m_runningParticleEmittersList.erase( ppParticleEmitter );
}
else
{
++ppParticleEmitter;
}
}
Exit:
return rval;
}