MCPcopy Create free account
hub / github.com/carbonengine/trinity / EnableParticleEmitting

Method EnableParticleEmitting

trinity/Eve/SpaceObject/EveMissileWarhead.cpp:229–254  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Enables or disables all attached particle systems. This is used to enable/ dsiable general trails. Arguments: enable - on or off --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

227// enable - on or off
228// --------------------------------------------------------------------------------
229void EveMissileWarhead::EnableParticleEmitting( bool enable )
230{
231 // try to find all attached GPU particle systems
232 for( PIEveTransformVector::const_iterator it = m_children.begin(); it != m_children.end(); ++it )
233 {
234 EveTransformPtr child;
235 if( ( *it )->QueryInterface( BlueInterfaceIID<EveTransform>(), (void**)&child, BEQI_SILENT ) )
236 {
237 // do we have an attached GPU emitter?
238 for( auto emIt = child->m_particleEmitters.begin(); emIt != child->m_particleEmitters.end(); ++emIt )
239 {
240 if( auto emitter = dynamic_cast<Tr2GpuSharedEmitter*>( *emIt ) )
241 {
242 emitter->Enable( enable );
243 }
244 }
245 }
246 }
247 for( auto emIt = m_particleEmitters.begin(); emIt != m_particleEmitters.end(); ++emIt )
248 {
249 if( auto emitter = dynamic_cast<Tr2GpuSharedEmitter*>( *emIt ) )
250 {
251 emitter->Enable( enable );
252 }
253 }
254}
255
256// --------------------------------------------------------------------------------
257// Description:

Callers 2

InitializeMethod · 0.80
StartMethod · 0.80

Calls 4

QueryInterfaceMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
EnableMethod · 0.45

Tested by

no test coverage detected