Anybody have experience with Chipmunk Physics?

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Anybody have experience with Chipmunk Physics?

Post by epicasian »

If so, could you point me in the direction of a tutorial with the basics of it?
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Anybody have experience with Chipmunk Physics?

Post by avansc »

Just gave it a quick overview, its rather impressive.

I see what you mean, the documentation is a bit lacking. if you checkout the svn and build that, a simple cmake . && make && sudo make install will do, it comes with a bunch of examples that will pretty much show you how do whatever.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Re: Anybody have experience with Chipmunk Physics?

Post by JS Lemming »

*wipes dirt off brow*

I chose Chipmunk over Box2D for my latest "project". It's more straight forward in my opinion. I also think the simulation is less floaty than Box2D's. I checked out the demos to get the basics.

*goes back underground*
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
lotios611
Chaos Rift Regular
Chaos Rift Regular
Posts: 160
Joined: Sun Jun 14, 2009 12:05 pm
Current Project: Game engine for the PC, PSP, and maybe more.
Favorite Gaming Platforms: Gameboy Micro
Programming Language of Choice: C++

Re: Anybody have experience with Chipmunk Physics?

Post by lotios611 »

The official docs are here.
"Why geeks like computers: unzip, strip, touch, finger, grep, mount, fsck, more, yes, fsck, fsck, fsck, umount, sleep." - Unknown
slembcke@gmail.com
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 1
Joined: Mon Feb 28, 2011 6:54 am

Re: Anybody have experience with Chipmunk Physics?

Post by slembcke@gmail.com »

Sorry about that. I suppose I really need to get around to making a simple end to end demo at some point. :oops: A few hours before leaving for GDC is probably not the time to do it though. :-\

The big things that maybe aren't super obvious from just looking at the demos:
  • Most Chipmunk structs have a void *data field that you can use as a pointer to the game object that owns the physics object. Use this to reference your game data from within Chipmunk callbacks.
  • You can trivially build a transformation matrix from a cpBody pointer (example). I usually do that at render time. A lot of people do a copy phase, iterating over the rigid bodies or shapes in the space and copying the position/angle to their sprite data structures. I don't really recommend this as the performance doesn't scale well and it assumes a 1:1 relation between sprites and bodies or shapes.
Is this for a Dreamcast project out of curiosity? I'm not sure if Chipmunk has ever been used on the Dreamcast. I've always wanted to try my hand at homebrew like that.
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Re: Anybody have experience with Chipmunk Physics?

Post by epicasian »

Well, I suppose the only way to learn is the demos. I just hope I have some time soon with school and crap like that.
slembcke@gmail.com wrote: Is this for a Dreamcast project out of curiosity? I'm not sure if Chipmunk has ever been used on the Dreamcast. I've always wanted to try my hand at homebrew like that.
I'm eventually going to port my project to the Dreamcast. I just hope when I build the static lib, it's painless because I'm not too good with compiler errors :| .

And if you do plan about doing some homebrew, I highly recommend developing for the Dreamcast. The native libraries are very straight forward and easy to learn.
Post Reply