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

Method UpdateAllSystems

trinity/Particle/Tr2ParticleSystem.cpp:844–866  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Per-frame update method for all created Tr2ParticleSystem objects. Calls Update method of each system asyncronously. Arguments: arguments - Child emitter update arguments --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

842// arguments - Child emitter update arguments
843// --------------------------------------------------------------------------------------
844void Tr2ParticleSystem::UpdateAllSystems( const ITr2GenericEmitter::UpdateArguments& arguments )
845{
846 CCP_STATS_ZONE( __FUNCTION__ );
847
848 static Be::Time previousUpdateTime = -1;
849
850 s_aliveParticleCount = 0;
851 s_updatedParticleCount = 0;
852
853 if( previousUpdateTime != -1 && previousUpdateTime == arguments.time )
854 {
855 return;
856 }
857
858 std::set<Tr2ParticleSystem*>& allSystems = GetAllSystems();
859
860 Tr2ParallelDo( allSystems.begin(),
861 allSystems.end(),
862 [=]( Tr2ParticleSystem* system ) { system->Update( arguments ); } );
863
864 CCP_STATS_SET( statAliveParticleCount, s_aliveParticleCount );
865 CCP_STATS_SET( statUpdatedParticleCount, s_updatedParticleCount );
866}
867
868// --------------------------------------------------------------------------------------
869// Description:

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected