Hi!
I was having a trouble, I was creating a rigid body and adding a collision listener while the collision() was happening (on that code), causing concurrent linked list access;
I did this change that fixed it here:
[patch]
Index: src/jbullet/com/jme3/bullet/PhysicsSpace.java
===================================================================
— src/jbullet/com/jme3/bullet/PhysicsSpace.java (revision 7793)
+++ src/jbullet/com/jme3/bullet/PhysicsSpace.java (working copy)
@@ -347,7 +347,7 @@
synchronized (collisionEvents) {
for (Iterator<PhysicsCollisionEvent> it = collisionEvents.iterator(); it.hasNext() {
PhysicsCollisionEvent physicsCollisionEvent = it.next();
-
for (PhysicsCollisionListener listener : collisionListeners) {<br />
-
for (PhysicsCollisionListener listener : collisionListeners.toArray(new PhysicsCollisionListener[]{})) {<br />
listener.collision(physicsCollisionEvent);
}
//recycle events
[/patch]
I just wonder if it is ok or if I should avoid doing that on that thread? may be create the other rigid body later?