+void addOrRemoveParticles()
+{
+ Autolock lock( muSetPart );
+
+ // add new Particle*s to Active
+ for( setPart::iterator it = particles_To_Add.begin();
+ it != particles_To_Add.end();
+ it++ )
+ {
+ active_Particles.insert(*it);
+ }
+ particles_To_Add.clear();
+
+ // remove dead Particle*s from Active
+ for( setPart::iterator it = particles_To_Remove.begin();
+ it != particles_To_Remove.end();
+ it++ )
+ {
+ active_Particles.erase(*it);
+ }
+ particles_To_Remove.clear();
+}
+void addOrRemovePhysics()
+{
+ Autolock lock( muSetPhys );
+
+ // add new PhysicsEntity*s to Active
+ for( setPhys::iterator it = physics_To_Add.begin();
+ it != physics_To_Add.end();
+ it++ )
+ {
+ active_Physics.insert(*it);
+ }
+ physics_To_Add.clear();
+
+ // remove dead PhysicsEntity*s from Active
+ for( setPhys::iterator it = physics_To_Remove.begin();
+ it != physics_To_Remove.end();
+ it++ )
+ {
+ active_Physics.erase(*it);
+ }
+ physics_To_Remove.clear();
+}