当前位置: 首页>>代码示例>>C++>>正文


C++ ParticleEmitter::Stop方法代码示例

本文整理汇总了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++;
	}
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:14,代码来源:ParticleEffectComponent.cpp

示例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();
			}
		}
	}
}
开发者ID:vilonosec,项目名称:dava.framework,代码行数:20,代码来源:ParticleEffectComponent.cpp

示例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;
}
开发者ID:kabinud,项目名称:HappyGame,代码行数:75,代码来源:ParticleManager.cpp


注:本文中的ParticleEmitter::Stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。