简体   繁体   中英

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:

cpSpaceFreeChildren(space);
cpSpaceFree(space);

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?

我忘了安排我的tick:函数,该函数在释放空间之前调用cpstep ...现在正在工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM