Chipmunk objects disappearing under certain conditions
I’m a cocos noob and I’m trying to build something based on 2d physics. I’ve downloaded the programmer’s guide samples and, in chapter 12, i’m tinkering with PhysicsDemoCorrelationToSprite code.
The program creates a certain number of physics objects and set them up in random places on the screen, giving them random velocity. Those objects are limited by a world edge box, so they rebound as they get to the screen limits, back and forth, and over and over on each other.
Then, I let a new object enter the screen following a simple straight path and colliding with them. This object has the same rules of the others except that it is led by a move to action.
I observed some behaviors regarding chipmunk physics (I’m using c++ 3.6 cocos2dx) I’d like a confirmation of. My guess:
a) when two objects happen to find themselves in the same phisical space position, one is destroyed.
This can be seen at times when the simulation starts; sometimes the demo randomly places two (I’ve seen more) objects in the same place: one disappears.
Note that the world is set to let the object collide and rebound away, so this should’n be possible. But random positioning makes it happen.
b) an object under a “move” action behaves like a static object with infinite mass, even if it is defined differently.
Such a move action pushes other objects away bruntly, like it were a crashing level wall. Anyway something else interesting happens:
c) This crashing level wall hits another object at the world limit. If hit in a way it cannot find an “escape route”, this object is pushed to the world’s edge, encounters a barrier, and disappears (is destroyed). Same thing as a)? Or another mechanic?
d) It seems the objects disappear in another condition, too; when they are pushed beyond a limit in velocity after a hit. They rocket out of the screen… disappearing. It is similar too c), but doesn’t happen at the world boundary…
My questions are:
- what happens to the object when it disappear? is there a event/condition in the engine I can check to catch it and, for instance, play a self destruct animation?
- or this is a chipmunk engine known behaviour so the only way to set for it is running a physics world update listener and continuosly check for the object presence in play? If so, getting a destruction effect to play just before it could not be possible…
Thank you everybody and sorry for tl;dr; 
