Chipmunk C++ Wrapper

Share your projects and Chipmunk enhancements.

Chipmunk C++ Wrapper

Postby jhasse » Wed Mar 07, 2012 10:04 am

Hi!

I've created a new C++ wrapper for Chipmunk 6. The old one wasn't using a namespace, depended on boost::shared_ptr and was tested only with Chipmunk 4.

http://github.com/jhasse/chipmunkpp/

It's not finished yet, but I will improve it in the next weeks. Please tell me what you think of it and if you have any suggestion for the design, code style, etc. ;)
Last edited by jhasse on Sat Sep 29, 2012 9:27 pm, edited 2 times in total.
jhasse
 
Posts: 6
Joined: Tue Mar 06, 2012 11:02 am

Re: Chipmunk C++ Wrapper

Postby jhasse » Fri Jun 15, 2012 6:00 am

I've created a small homepage using github: http://jhasse.github.com/chipmunkpp/

@slembcke
Could you add my wrapper to http://chipmunk-physics.net/bindingsAndPorts.php ? :)

Btw: The bindings and ports link at http://chipmunk-physics.net/release/Chi ... test-Docs/ is broken ;)
Last edited by jhasse on Sat Sep 29, 2012 9:27 pm, edited 1 time in total.
jhasse
 
Posts: 6
Joined: Tue Mar 06, 2012 11:02 am

Re: Chipmunk C++ Wrapper

Postby aisman » Fri Jun 15, 2012 6:58 am

Hello jhase,

Can you tell us which Chipmunk version and the completenes of the wrapper?
Chipmunk4PB: The fastest way to write games together with PureBasic and the Chipmunk physics engine.
User avatar
aisman
 
Posts: 140
Joined: Tue Mar 04, 2008 2:21 am

Re: Chipmunk C++ Wrapper

Postby jhasse » Fri Jun 15, 2012 8:00 am

aisman wrote:Hello jhase,

Can you tell us which Chipmunk version and the completenes of the wrapper?

Hi,

It's using the latest version (6.1.1) and it isn't complete yet (maybe 20%?). I'm already using it in my project, but I only use a small amount of Chipmunk atm (e.g. no joints, etc.). Sorry :(
jhasse
 
Posts: 6
Joined: Tue Mar 06, 2012 11:02 am

Re: Chipmunk C++ Wrapper

Postby slembcke » Fri Jun 15, 2012 12:34 pm

Updated!

I've been pondering about making an official Chipmunk C++ wrapper for a while now. (I just rarely program in C++) I have a ruby script in Git called "extract_protos.rb" that I use for pulling all the function data for working on the docs sometimes. It should make it pretty easy to generate a set of C++ bindings from a script. The C/C++ API would be almost entirely a 1:1 correspondence anyway. I'm not quite sure exactly how long that would take though.

Anyway. It's much appreciated that you are filling this need until/if I have time to make a more complete solution. :) Thanks!
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Chipmunk C++ Wrapper

Postby jhasse » Mon Jun 18, 2012 7:59 am

slembcke wrote:Updated!

Thanks!

I've been pondering about making an official Chipmunk C++ wrapper for a while now. (I just rarely program in C++) I have a ruby script in Git called "extract_protos.rb" that I use for pulling all the function data for working on the docs sometimes. It should make it pretty easy to generate a set of C++ bindings from a script. The C/C++ API would be almost entirely a 1:1 correspondence anyway. I'm not quite sure exactly how long that would take though.

Unfortunately it isn't that easy, especially if you're trying to make a modern and nice wrapper. For example the cpSpaceSegmentQuery function I've implemented today in Chipmunk++ is quite different than a simple wrapper in order to allow passing lambdas:

Code: Select all
space.segmentQuery(a, b, ALL_LAYERS, NO_GROUP, [&](std::shared_ptr<Shape> shape, Float, Vect) {
   // do something with shape
});
jhasse
 
Posts: 6
Joined: Tue Mar 06, 2012 11:02 am


Return to Community Creations

Who is online

Users browsing this forum: No registered users and 1 guest

cron