Chipmunk 5.3.0 is out!

Official forum for the Chipmunk2D Physics Library.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Chipmunk 5.3.0 is out!

Post by slembcke »

Chipmunk 5.3.0 is out! The biggest new feature is that I've added the ability for inactive objects to fall asleep, reducing the CPU and battery usage. There are a number of other smaller performance improvements and fixes as well.

Source Code
OSX Demo Binary
Windows Demo Binary
iPhone Demo App

CHANGES SINCE 5.2.0:
  • FIX: Fixed the source so it can compile as C, C++, Objective-C, and Objective-C++.
  • FIX: Fixed cp_contact_persistence. It was broken so that it would forget collision solutions after 1 frame instead of respecting the value set.
  • OPTIMIZATION: Several minor optimizations have been added. Though performance should only differ by a few percent.
  • OPTIMIZATION: Chipmunk now supports putting bodies to sleep when they become inactive.
  • API: Elastic iterations are now deprecated as they should no longer be necessary.
  • API: Added API elements to support body sleeping.
  • API: Added a statically allocated static body to each space for attaching static shapes to.
  • API: Static shapes attached to the space's static body can simply be added to the space using cpSpaceAddShape().
  • NEW: New MSVC projects.
  • NEW: Added boolean and time stamp types for clarity.
We've also included the Objective-C wrapper as well as some sample code from shipping iPhone Apps. The primary advantages of a native Objective-C API include integrating with the Cocoa memory management model and the Chipmunk Object protocol. The Chipmunk Object protocol unifies the basic Chipmunk types as well as making it easy to create custom composite collections of the basic types. Additionally, the wrapper adds many convenience methods for doing common setup tasks as well as helper methods that integrate it with the rest of the Cocoa Touch API. The wrapper tries to do things the Objective-C way, adding useful method variations where it makes sense to do so. Objective-Chipmunk is cheap to license and it will definitely save you time and money developing Chipmunk based iPhone apps.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Zardozjones
Posts: 4
Joined: Tue Aug 10, 2010 12:07 am
Contact:

Re: Chipmunk 5.3.0 is out!

Post by Zardozjones »

Sweet!!

Gotta say I Just started playing around with chipmunk yesterday for my iphone/windows projects and it's everything that I wanted for a physics engine : clarity, small code size(this is really important to me - less code = less bugs = easier to change). I only really had 2 issues:
1) Sleeping objects 2) Continuous physics - and I was about to post about suggestions for sleeping objects. Totally lucked out today - awesome!! will Spend the day in geeky physics heaven tinkering about :P

My initial verdict on this engine is :

It's great - the tiny code size is win win win all the way

Love the api and extremely clean interface

top work slembcke - I'm mightily impressed!
Zardozjones
Posts: 4
Joined: Tue Aug 10, 2010 12:07 am
Contact:

Re: Chipmunk 5.3.0 is out!

Post by Zardozjones »

Just had a quick play with 5.3.0

I'm using c++ builder v6.0 - and all the versions so far don't compile directly (c99 spec problem I think, and missing typeof function for MAKE_REV and a few other small problems) - so I just rename .c to .cpp (so lazy :P )

Couldn't get sleeping working for a while - even tho I read "The first is that you must use the space’s static body to attach your static shapes to." in the docs several times :P

Sleeping now works a treat, I had to play with the sleepTimeThreshold time (0.0125f for my test,object are 10-150 in size and masses are 1-10) - and it's great - does what it says on the tin!
User avatar
pat
Posts: 53
Joined: Tue Jul 20, 2010 7:55 pm
Contact:

Re: Chipmunk 5.3.0 is out!

Post by pat »

That's Great!

Very cool seeing the Demo, Couldn't get it building before. Awesome.

Looking forward to checking out sleep.

Has cpSpaceAddStaticShape been removed?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 5.3.0 is out!

Post by slembcke »

pat wrote:Has cpSpaceAddStaticShape been removed?
No, but shapes attached to the space's static body (space->staticBody) are automatically flagged as being static shapes. So you won't need it for new code unless you want to attach a static shape to a rogue static body.

Longer description in the docs: http://files.slembcke.net/chipmunk/rele ... s/#cpSpace
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
pat
Posts: 53
Joined: Tue Jul 20, 2010 7:55 pm
Contact:

Re: Chipmunk 5.3.0 is out!

Post by pat »

Thanks, I take it when using constraints with the static body (like anchr points)are basically world space then?

Btw i think i found a typo
Because static shapes are only rehashed when you request it, it’s possible to use a much higher count argument to cpHashResizeStaticHash() than to cpHashResizeStaticHash(). Doing so will use more memory but can improve performance if you have a lot of static shapes.

should that be cpSpaceResizeActiveHash?

Thanks again for replying so quickly. Your activity is another great plus to chipmunk.

I donno if theres intrest in it, but i've made a Squirrel. love MIT. chipmunk and squirrel work pretty well together.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Chipmunk 5.3.0 is out!

Post by slembcke »

I could swear I've fixed that typo like 3 times. :( What the crap. Well it's fixed for sure in the trunk documentation this time at least and I'm not screwing around with the google code wiki any more.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Zardozjones
Posts: 4
Joined: Tue Aug 10, 2010 12:07 am
Contact:

Re: Chipmunk 5.3.0 is out!

Post by Zardozjones »

hey Pat that's soo freaky
I donno if theres intrest in it, but i've made a Squirrel. love MIT. chipmunk and squirrel work pretty well together.
thats *Exactly* what I'm using for my pc/iphone stuff - I choose squirrel because of the tiny code size (too many times designers go
mad with LUA and stuff things up :) ).

I'm using the 2 in a Hi-Low setup - Hi level (squirrel) Low level block processing (chipmunk) - and it works a treat!

So most of my processing is done with block commands - taking any slow down away from squirrel:

phyRenderQuads(Mask); - this will render all physics objects of a certain mask type as quads e.t.c.

so far it's the way to go!
User avatar
pat
Posts: 53
Joined: Tue Jul 20, 2010 7:55 pm
Contact:

Re: Chipmunk 5.3.0 is out!

Post by pat »

Zardozjones wrote:hey Pat that's soo freaky
Haha yea, thats awesome. I love squirrel. When i was working with Novint Technologies I was in-charge of this PC Game profiler (F-Gen) that lets people play all games with the Novint Falcon. I chose squirrel for the scripting/c++ plugin part of it and its been a big hit in that community.

But yea anyways if theres a API named after a rodent, I generally get interested quick now.
Paul10
Posts: 17
Joined: Sat Jul 31, 2010 8:27 am
Contact:

Re: Chipmunk 5.3.0 is out!

Post by Paul10 »

Hi there.

It seems my code that worked with Chipmunk 5.2.0 is not working with 5.3.0.

It crashes on load:

Code: Select all

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000004
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   Scoring               	0x000079cc cpHashSetEach + 84 (cpHashSet.c:220)
1   Scoring               	0x00008f9a cpSpaceHashEach + 56 (cpSpaceHash.c:331)
I'm using images called Balls. I'm only loading 10 of them like this for each.

Code: Select all

		ballImage = (UIImageView *)image;
		ballBody = cpBodyNew(100.0, INFINITY);
		ballBody->p = cpv(ballImage.center.x, 480 - ballImage.center.y);
		cpSpaceAddBody(space, ballBody);
		ballShape = cpCircleShapeNew(ballBody, 16.0, cpvzero);
		ballShape->e = 0.5; // Elasticity
		ballShape->u = 0.3; // Friction
		ballShape->data = ballImage;
		ballShape->collision_type = 1;
		cpSpaceAddShape(space, ballShape);
I have a timer like so:

Code: Select all

	[NSTimer scheduledTimerWithTimeInterval:1.0f/100.0f target:self selector:@selector(tick:) userInfo:nil repeats:YES];
And that timer does the following:

Code: Select all

	cpSpaceStep(space, 1.0f/60.0f);
	cpSpaceHashEach(space->activeShapes, &updateShape, self);
The app crashes on the cpSpaceHashEach statement. It never makes it into my "updateShape" method. I figured cpSpaceHashEach would be ok since I only have 10 images..not a ton to loop thru.

Any suggestions?

Thanks,
Paul
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 24 guests