Introducing Chipmunk 5.2.0 and Objective-Chipmunk

February 23rd, 2010| Posted by Andy Korth
Categories: Uncategorized | Tags:

Introduction

Howling Moon Software is proud to announce an update to Chipmunk Physics, the powerful 2D physics engine used in many hit iPhone, Mac, PSP, and even Nintendo DS games. Version 5.2.0 includes several major optimizations, a few small fixes, and includes the new Objective-C wrapper and utility functions.

What’s New?

Objective-Chipmunk provides native integration with the Objective-C’s memory management model and also provides many convenience methods for common setup tasks. It includes the Chipmunk Object Protocol which facilitates the easy addition of Chipmunk bodies and joints to the space. It also lets you easily create compound objects and keep your physics code organized. The binding also has numerous helpful iPhone features which allow you to easily interact with the Cocoa Touch libraries. A full and complete published iPhone game is included with the binding, so you have a great set of examples and a starting point for your program.

Changes Since 5.1.0:

  • OPTIMIZATION: Chipmunk structs used within the solver are now allocated linearly in large blocks. This is much more CPU cache friendly. Programs have seen up to 50% performance improvements though 15-20% should be expected.
  • FIX: separate() callbacks are called before shapes are removed from the space to prevent dangling pointers.
  • API: Shape references in cpArbiter structs changed to private_a and private_b to discourage accessing the fields directly and getting them out of order. You should be using cpArbiterGetShapes() or CP_ARBITER_GET_SHAPES() to access the shapes in the correct order.
  • API: Added assertion error messages as well as warnings and covered many new assertion cases.
  • NEW: Added convenience functions for creating box shapes and calculating moments.

The Objective-Chipmunk wrapper is free to use on Mac OS X as well as the iPhone simulator. Access to the iPhone optimized build of the library costs $200 per title to license. Purchase Objective-Chipmunk via paypal or contact us at admin (at) howlingmoonsoftware.com for more information or other purchasing options.

Getting Started with Chipmunk

More information is available on the Objective-Chipmunk page. To get started, download Chipmunk from google code. The binding is included in the latest version.

Once you have grabbed and decompressed the latest version of Chipmunk, the best way to get started is to take a look at the examples. Fortunately, everything will build very easily and is ready to go. I’m going to start with the iPhone examples, since there’s so much interest with the iPhone (and iPad!). I’m going to assume you’ve already installed the developer tools and iPhone SDK. If not, head over to Apple’s Developer site and grab them. This short introduction doesn’t require you to sign up for the iPhone program!


Open up “Objective-Chipmunk/iPhoneChipmunk”, and launch the xCode project. Just click the “Build and Run” button and the demo app will launch in the simulator! From there, you can get a sense of what is possible with chipmunk, and then you can take a look at the corresponding source code file to see how it’s done! For example “Demos/OneWay.m” demonstrates oneway platforms, as you’d find in many platform games. This is one of the new features that was made possible by the solver changes in Chipmunk 5.0- so if you’re new to Chipmunk or even a Chipmunk veteran, there’s something for you to learn in the included tutorials.

Comments are closed.