Page 1 of 2

Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Sun Nov 29, 2015 11:31 pm
by Lunasole
First of all, thanks to all here who helped me with some import issues related to MSVC++ compiler.
Chipmunk is very nice open-source phys engine that can be used in complex 2D games for advanced collision handling or complete world physics simulation.
It is written in pure C and this makes a difference too (not for speed only), cause no wrapper needed to use it from PB, unlike other solutions like BOX2D with their damn POO classes.

So here are my bindings including simple helloworld example and .lib binaries: http://geocities.ws/lunasole


Some general documentation: https://chipmunk-physics.net/release/Ch ... test-Docs/

Also other info and and full engine sources here: https://chipmunk-physics.net/
(anyway you need to look on it's sources/official demos sources, cause using it without that might be hard way [even with sources sometimes it is :)])

*currently only Windows x86/x64 versions

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Mon Nov 30, 2015 8:13 am
by Fred
May be you can post the include file directly on this forums as text, so it won't get lost

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Mon Nov 30, 2015 8:51 pm
by Lunasole
Fred wrote:May be you can post the include file directly on this forums as text, so it won't get lost
They are using customized version of Chipmunk lib (fixed for compatibility with PB without using wrappers) so without binaries includes are useless.

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Thu Dec 03, 2015 3:23 am
by Lunasole
Just updated files to new version.
- ported lot of cpv_ math functions (all or almost all of them)
- added some others
- included debug version of chipmunk lib (it should warn about doing something wrong, but seems It didn't warns, so maybe useless)

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Thu Dec 03, 2015 4:04 pm
by juankprada
Maybe you can use something like GitHub or Bitbucket to share it?

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Thu Dec 03, 2015 10:50 pm
by Lunasole
juankprada wrote:Maybe you can use something like GitHub or Bitbucket to share it?
I'm too lazy to reg on such sites 8) But should be good idea, ty.
After the work with it all will be more or less finished I'll post results to github or similar, currently just continue updating file here.

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Tue Dec 08, 2015 1:46 am
by Lunasole
Another update
- fixed bug with cpBool type (chipmunk was returning unsigned char byval and PB was unable to use it properly, changed type to int)
- some basic fix to cpMessage, very basic fix: it only writes single message to "_chipmunk_error.log" if chipmunk crashes. but that is enought for now
- added callback prototypes / fixed their params, and some other stuff

+ spotted another problem with 2 callback prototypes which have to return structures byval

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Mon Dec 14, 2015 1:39 am
by mpz
Dear lunasole,

i am working on mp3d and use Chipmunk verion 5 as 2d Physic engine. Will you make a x64 version for this lib too? I am interresting on it to use your chipmunk 7 in my engine, but i use MP3D as x86 and x64 lib...

Greetings Michael

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Mon Dec 14, 2015 6:04 pm
by Lunasole
mpz wrote:Dear lunasole,

i am working on mp3d and use Chipmunk verion 5 as 2d Physic engine. Will you make a x64 version for this lib too? I am interresting on it to use your chipmunk 7 in my engine, but i use MP3D as x86 and x64 lib...

Greetings Michael
Hi.
I have compiled x64 lib after your msg, but there are problems with C int size and similar, leading to memory errors inside engine.
Unfortunately It all requires detailed review of chipmunk code and takes time to fix and test everything (I guess, several days), currently I'm working on my project with 32bit version and planning to adopt x64 only sometime later.
For now I can only give you the x64 .lib file itself and related imports list if that can help.
Or maybe IceSoft can help you, he is working with 7 version too.

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Tue Dec 15, 2015 3:23 pm
by Lunasole
Updated to 0.38 after spotted some bugs today

Code: Select all

- fixed cpMomentForBox, cpBoxShapeInit, cpBoxShapeNew functions : earlier parser missed their cpBB byval params due to stupid bug
- fixed incorrect symbols in some functions [that was a parser mistake too]
- added common function to safe deletion of single body and some other small improvements

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Wed Dec 16, 2015 1:29 am
by mpz
Dear lunasole,

i will test the 32bit lib in my engine in the next time and hope you may a x64 version of it. I think x64 is the future...

Greetings Michael

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Wed Dec 16, 2015 12:58 pm
by Lunasole
mpz wrote:Dear lunasole,

i will test the 32bit lib in my engine in the next time and hope you may a x64 version of it. I think x64 is the future...

Greetings Michael
If you find any bugs or improvements please post.
x64 surely has to be done but currently I can't tell when I will do everything with it, I'm mostly busy with all others things.

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Fri Dec 18, 2015 8:27 am
by Lunasole
Well, I have some good news 8)
Today I found some time to deal with x64 version and did it [instead of going to sleep, hah].
So there is version 0.39 in first post, it seems working [at least with helloword ^^]

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Sun Dec 27, 2015 6:22 pm
by Lunasole
In total it all seems working fine, but I'm currently playing only with x86 version in my code.
Maybe later also remove those _pb extensions from some functions if make completely sure it all works as should [or find a more nice way to deal with those "structures by val" than modifying engine sources, currently have no much time to play with all this]
- a very minor but important update: removed structure align by 4 bytes, because of "KISS" :)

Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Posted: Fri Jan 01, 2016 1:58 pm
by mpz
Hi Lunasole,

Thanks for your work. I have time in the new year and will test it with my sprite engine.

Greetings Michael