Thread overview
D bindings to Chipmunk2D 7.0.1
Mar 01, 2016
rcorre
Mar 02, 2016
Kyle
Mar 02, 2016
Andrej Mitrovic
Mar 03, 2016
rcorre
March 01, 2016
chipmunkd [1] provides D bindings for the most recent version (7.0.1) of
Chipmunk2D [2], a 2D physics library.

Note that there is also DChip [3], which provides a full source port and is
currently targeting the 6.X branch. I figured bindings would be easier to keep
up to date with upstream releases than a full source port, though DChip has the
advantage of not requiring another dependency (and of having nicer-to-look at
source code?).

The ported demos seem to be working, but they depend on the rather outdated
glfw2. If you have glew and glfw2, you should be able to run the demos with dub.
Some of them look pretty cool.

The demo directory contains some hacked-together glfw2/glew bindings that were
just enough to get it working.

I also just realized Jakob Orvum already had some bindings [4], though they are a
few years out of date. In retrospect, I probably should have based my work on that. I really should research these things more thouroughly before I dive in. Oops.

The bindings were created with the help of dstep [5] (and a fair bit of manual
post-processing).

[1] https://github.com/rcorre/chipmunkd
[2] http://chipmunk-physics.net/
[3] https://github.com/d-gamedev-team/dchip
[4] https://github.com/JakobOvrum/ChipmunkD
[5] https://github.com/jacob-carlborg/dstep
March 02, 2016
Thanks! I look forward to trying this out.
March 02, 2016
On 3/1/16, rcorre via Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> chipmunkd [1] provides D bindings for the most recent version
> (7.0.1) of
> Chipmunk2D [2], a 2D physics library.
>
> Note that there is also DChip [3], which provides a full source
> port and is
> currently targeting the 6.X branch. I figured bindings would be
> easier to keep
> up to date with upstream releases than a full source port, though
> DChip has the
> advantage of not requiring another dependency (and of having
> nicer-to-look at
> source code?).

I ported it to D as I'm interested if it could improve performance since you could theoretically inline code. I haven't touched the code in a long time, though. Nice to see bindings too however!
March 03, 2016
On Wednesday, 2 March 2016 at 15:06:26 UTC, Andrej Mitrovic wrote:
>
> I ported it to D as I'm interested if it could improve performance since you could theoretically inline code. I haven't touched the code in a long time, though. Nice to see bindings too however!

Thanks! Porting is an admirable goal, but the thought of keeping a full port up to date scared me :)

Then again, Chipmunk has so many functions inlined in it's headers I had to do a fair bit of porting anyways, and most of it doesn't have to change too much to be valid D.