Oscar Gomez Oscar Gomez - 2 years ago 94
C Question

How can I free chipmunks space?

I am using chipmunk as a physics engine in my game. The problem is I now want to free all the children and then the space itself, so I can create a new space for the new level. I tried this:


But it does not work and fails in:

cpHashSetReject(cpHashSet *set, cpHashSetRejectFunc func, void *data)
// Iterate over all the chains.
for(int i=0; i<set->size; i++){ <-- here

Is there anything I need to clean up before calling this two methods?

Answer Source

I forgot to unschedule my tick: function that calls cpstep before freeing the space... It is working now.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download