projects
/
physics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added better thread safty ... still broke
[physics.git]
/
src
/
entityManager.cpp
diff --git
a/src/entityManager.cpp
b/src/entityManager.cpp
index
65b8273
..
1664210
100644
(file)
--- a/
src/entityManager.cpp
+++ b/
src/entityManager.cpp
@@
-132,6
+132,16
@@
void manager::draw()
Autolock lock( particleSetLock );
DPF(0, "Particle Draw Start");
Autolock lock( particleSetLock );
DPF(0, "Particle Draw Start");
+ // remove dead Particle*s from Active
+ for( setPart::iterator it = particles_To_Remove.begin();
+ it != particles_To_Remove.end();
+ it++ )
+ {
+ DPF(0, "Particle Delete");
+ active_Particles.erase(*it);
+ }
+ particles_To_Remove.clear();
+
// update active Particle*s
for( setPart::iterator it = active_Particles.begin();
it != active_Particles.end();
// update active Particle*s
for( setPart::iterator it = active_Particles.begin();
it != active_Particles.end();
@@
-147,6
+157,16
@@
void manager::draw()
Autolock lock( physicsEntitySetLock );
DPF(0, "Physics Draw Start");
Autolock lock( physicsEntitySetLock );
DPF(0, "Physics Draw Start");
+ // remove dead PhysicsEntity*s from Active
+ for( setPhys::iterator it = physics_To_Remove.begin();
+ it != physics_To_Remove.end();
+ it++ )
+ {
+ DPF(0, "Physics Delete");
+ active_Physics.erase(*it);
+ }
+ physics_To_Remove.clear();
+
// update active PhysicsEntity*s
for( setPhys::iterator it = active_Physics.begin();
it != active_Physics.end();
// update active PhysicsEntity*s
for( setPhys::iterator it = active_Physics.begin();
it != active_Physics.end();
@@
-183,10
+203,10
@@
void updateParticles(float time_step)
DPF(0, "Particle Delete");
active_Particles.erase(*it);
}
DPF(0, "Particle Delete");
active_Particles.erase(*it);
}
+ particles_To_Remove.clear();
}
particles_To_Add.clear();
}
particles_To_Add.clear();
- particles_To_Remove.clear();
// update active Particle*s
for( setPart::iterator it = active_Particles.begin();
// update active Particle*s
for( setPart::iterator it = active_Particles.begin();
@@
-218,9
+238,9
@@
void updatePhysics(float time_step)
DPF(0, "Physics Delete");
active_Physics.erase(*it);
}
DPF(0, "Physics Delete");
active_Physics.erase(*it);
}
+ physics_To_Remove.clear();
}
}
- physics_To_Remove.clear();
physics_To_Add.clear();
// apply collision math
physics_To_Add.clear();
// apply collision math