It is currently Fri Oct 18, 2019 2:27 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Sun Nov 29, 2015 11:31 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Last edited by Lunasole on Wed Jun 22, 2016 3:58 am, edited 10 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Mon Nov 30, 2015 8:13 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13622
Location: France
May be you can post the include file directly on this forums as text, so it won't get lost


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Mon Nov 30, 2015 8:51 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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.

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Thu Dec 03, 2015 3:23 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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)

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Thu Dec 03, 2015 4:04 pm 
Offline
User
User

Joined: Tue Mar 18, 2014 4:25 pm
Posts: 62
Location: Bogotá, Colombia
Maybe you can use something like GitHub or Bitbucket to share it?


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Thu Dec 03, 2015 10:50 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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.

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Tue Dec 08, 2015 1:46 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Mon Dec 14, 2015 1:39 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 416
Location: Germany, Berlin > member German forum
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

_________________
Working on - MP3D Library -


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Mon Dec 14, 2015 6:04 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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.

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Tue Dec 15, 2015 3:23 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
Updated to 0.38 after spotted some bugs today
Code:
- 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

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Wed Dec 16, 2015 1:29 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 416
Location: Germany, Berlin > member German forum
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

_________________
Working on - MP3D Library -


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Wed Dec 16, 2015 12:58 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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.

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Fri Dec 18, 2015 8:27 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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 ^^]

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Sun Dec 27, 2015 6:22 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 908
Location: UA
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]
Quote:
- a very minor but important update: removed structure align by 4 bytes, because of "KISS" :)

_________________
Dreamness

Like a copyleft notify: all the source code created by me and posted on Purebasic official forums is free to use and modification in all possible (and several impossible) ways for anyone, without asking my permission


Top
 Profile  
Reply with quote  
 Post subject: Re: Interface to Chipmunk 7.0.1 [2D physics engine]
PostPosted: Fri Jan 01, 2016 1:58 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Oct 11, 2008 9:07 pm
Posts: 416
Location: Germany, Berlin > member German forum
Hi Lunasole,

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

Greetings Michael

_________________
Working on - MP3D Library -


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye