Page 5 of 8

Re: Chipmunk 6.0 Beta

Posted: Fri Apr 15, 2011 11:55 am
by funkaster
I'm testing the 6.0 beta and it's working just fine... the only problem I'm facing right now is random crashes when calling cpSpacePointQueryFirst (for a touch joint). I've tracked the problem and it happens the second time I create a space (for instance, the level 2 of a game), and it's because of this line:

Code: Select all

static inline	void
cpSpatialIndexPointQuery(cpSpatialIndex *index, cpVect point, cpSpatialIndexQueryFunc func, void *data)
{
	index->klass->pointQuery(index, point, func, data);
}
basically, index is corrupted: some times klass->pointQuery is NULL, others, just index is NULL.
I'm using svn revision 742. Any idea why the pointQuery pointer function might be null?

thanks!

Re: Chipmunk 6.0 Beta

Posted: Fri Apr 15, 2011 12:19 pm
by slembcke
I'm guessing that in all cases that the index pointer is invalid. The only place in Chipmunk where that is called is in cpSpacePointQuery() where it passes cpSpace.activeShapes and cpSpace.staticShapes to it. If either of those was a bad pointer, there should be terrible crashes when cpSpaceStep() is called. So I'm not quite sure what could be causing the crash you are seeing.

Out of curiosity, is it crashing on the static or active shapes index in cpSPacePointQuery()?

Re: Chipmunk 6.0 Beta

Posted: Sun Apr 17, 2011 3:16 pm
by funkaster
nah... nevermind, :oops: my bad: I was keeping an invalid object (touch delegate -cocos2d-) around, with a rotten pointer to an old space, that's why there was a problem.
Anyway... so far, so good! 6.x is looking really great!

Re: Chipmunk 6.0 Beta

Posted: Thu Apr 21, 2011 3:11 pm
by akamal
In 6.0, we have memory leaks at
cpBody *
cpBodyNewStatic()
{
return cpBodyInitStatic(cpBodyAlloc());
}

in cpBodyAlloc().

This happens only with static bodies, which we create, not with space->staticBody.

Re: Chipmunk 6.0 Beta

Posted: Thu Apr 21, 2011 3:49 pm
by slembcke
Where is the memory leak exactly?

Re: Chipmunk 6.0 Beta

Posted: Thu Apr 21, 2011 4:04 pm
by akamal
My bad, I was releasing all space->bodies at the end. I missed that space->bodies contain only active Bodies. I should keep track of all staticBodies allocated also, so that I can release them later.

Re: Chipmunk 6.0 Beta

Posted: Thu May 12, 2011 2:59 pm
by JavierTapulous
I've been using revision 742 for quite some time and it's rock solid.

Re: Chipmunk 6.0 Beta

Posted: Thu May 12, 2011 4:18 pm
by slembcke
Awesome. Good to hear. I admittedly haven't done a lot of testing on Chipmunk 6 other than a lot of demo/toys and a smallish set of unit tests. It's definitely helpful that people are playing with the beta even though there is pretty much zero documentation on what has changed.

We are a week or two away (hopefully) from being done with the Disney contract we've been working on. Definitely been crunching for the last few weeks. Once that is done I want to spend a few days to wrap up the Chipmunk 6 documentation and get it released. After that I want to spend a couple of weeks making some new example code and tutorials as Chipmunk has definitely been lacking in that area.

Re: Chipmunk 6.0 Beta

Posted: Wed May 18, 2011 5:16 am
by dieterweb
Hi Scott,

finally we switched to Chipmunk 6 for one of our new projects. I do not have to add that this will stress your engine to the max :)

So far it looks all good.

Can you add the patch you made to set a rogue body static (http://www.slembcke.net/forums/viewtopi ... a&start=10) to chipmunk 6?

Thomas

Re: Chipmunk 6.0 Beta

Posted: Wed May 18, 2011 8:39 am
by slembcke
Oh yeah, I forgot about that. I think I have most of those changes integrated into mainstream Chipmunk, just not the rouge -> static function. I'll take a look at that today.