Chipmunk 6.0 Beta

Official forum for the Chipmunk2D Physics Library.
Post Reply
funkaster
Posts: 7
Joined: Mon Dec 22, 2008 5:22 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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!
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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()?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
funkaster
Posts: 7
Joined: Mon Dec 22, 2008 5:22 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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!
akamal
Posts: 15
Joined: Fri Mar 11, 2011 3:32 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0 Beta

Post by slembcke »

Where is the memory leak exactly?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
akamal
Posts: 15
Joined: Fri Mar 11, 2011 3:32 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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.
JavierTapulous
Posts: 13
Joined: Fri Apr 01, 2011 3:17 pm
Contact:

Re: Chipmunk 6.0 Beta

Post by JavierTapulous »

I've been using revision 742 for quite some time and it's rock solid.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
dieterweb
Posts: 176
Joined: Fri Feb 27, 2009 7:12 am
Location: Germany
Contact:

Re: Chipmunk 6.0 Beta

Post 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
Visit our game Blog: [url]http://zombiesmash.gamedrs.com[/url] or follow us on twitter: [url]http://twitter.com/zombiesmash[/url]
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 6.0 Beta

Post 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.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests