Page 2 of 2

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

Posted: Sat Jan 02, 2016 7:57 am
by Lunasole
mpz wrote: Thanks for your work. I have time in the new year and will test it with my sprite engine.
Good luck to you.
I having no much experience playing with things like bindings/interfaces, so please write If you have any ideas/found bugs/etc about anything related to this stuff, or just can advice something to make it looking better or being more usable 8)

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

Posted: Mon Mar 21, 2016 11:55 pm
by Lunasole
At last I came to some tests of 64 bit version. It works fine with my current project, however I'm still not sure that all C types defined correctly for x64.

Also now I'm finding those my bindings made crude enough :D
Maybe I should split all the functions to separated interfaces, one per every category, i.e. space, constrains, shapes and so on, that can made code more ordered and clear.
Also, would be nice to create separated binaries with SSE/SSE2 support.
And also I think should try DLL instead of LIB, this will resolve POLINK conflict with MS VC++ compiler if optimizations are enabled.
And there should be better solution for procedures returning and taking structures byval, than rewriting them to pointers with adding "_pb" extension as I did before (that was stupid work, but better than to waste time trying to find other options).

But well, thats all secondary, I can say it works and thats enough for now, it even doesn't need SSE2 optimizations to be enabled, as engine is already good coded and very-very fast with lot objects (like tile-based world in Terraria style) even on oldest hardware.
Rather I should make build for linux, but don't know how soon.

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

Posted: Sun Mar 27, 2016 10:33 am
by Octavius
Hi,

I am interested in using 2D physics, I downloaded your chipmunk library. But then where should I begin? Is there any tuto? Or at least an example with a little game? What is the list of the new commands and how do they work? Thank you.

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

Posted: Sun Mar 27, 2016 12:38 pm
by Lunasole
Octavius wrote:Hi,

I am interested in using 2D physics, I downloaded your chipmunk library. But then where should I begin? Is there any tuto? Or at least an example with a little game? What is the list of the new commands and how do they work? Thank you.
The way how I learned it: readed its sources, readed docs, and experimenting with interesting functions trying to do something.
There are examples with some demos, but I was too lazy to port them to PB (lot of code and I didn't see enoughs reasons to port it), just ported simple helloworld to check engine and later ported some more to use in my code, but this is not complete demo to post it (it is binded to my game renderer and other systems).

So generally you should start by downloading sources, learn main engine principles, read C code of official demos and write something based on them.
Also here is a link with general docs: https://chipmunk-physics.net/release/Ch ... test-Docs/
And the Chipmunk forum itself should have some more examples and useful info.

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

Posted: Mon Mar 28, 2016 2:26 pm
by Octavius
Well, OK. Thank you.

Unfortunately I can't read C code, but your link is very helpful.
The helloworld demo does not show any graphical output, only printed coordinates, so I guess my first step will be to modify that demo to understand how it works.

I am not an experimented programmer, but if I happen to be able to make some working demos I will post them on the forum.

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

Posted: Tue Mar 29, 2016 3:51 am
by Lunasole
Octavius wrote: Unfortunately I can't read C code, but your link is very helpful.
I am not an experimented programmer, but if I happen to be able to make some working demos I will post them on the forum.
I highly recommend you to start learn C anyway (at least learn it to the level which allows you to translate its code to Purebasic), as C is "immortal classic" language and there are most serious things made on it or languages with similar syntax.
Octavius wrote: The helloworld demo does not show any graphical output, only printed coordinates, so I guess my first step will be to modify that demo to understand how it works.
Yes that simplest demo probably can be nicely visualised and extended with more interesting stuff than falling ball 8)
Good luck with your attempts and ask if you get some problems or questions about engine

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

Posted: Tue Mar 29, 2016 4:45 am
by Lunasole
Btw, I just updated binaries with this small change

Code: Select all

- redefined CP_EXPORT from "__declspec(dllexport)" to ""; with previous define the resulting EXE had export table with all chipmunk functions
I don't know who made msvc project originally, but that thing when your final executable (game) provides export table of included .lib was dirty and annoying ^^ Should fix it months ago, but as always was too lazy before.

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

Posted: Wed Jun 15, 2016 10:51 pm
by Lunasole
Update because of this

Code: Select all

http://geocities.ws/lunasole/
No more 30-days links, at last I've created some home page to host random stuff.... that should be done 8 or 12 years ago ^^

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

Posted: Sun Sep 18, 2016 9:08 am
by ShaunRW
I am a noob to PureBasic. How would I go about using the Chipmunk physics engine on Mac OSX?

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

Posted: Mon Sep 19, 2016 12:27 pm
by IceSoft
This is windows only compilied

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

Posted: Wed Apr 12, 2017 8:03 pm
by IceSoft
You can also use the Chipmunk4PB_7.01 :
http://www.purebasic.fr/english/viewtop ... 14&t=44068

Biggest news:
As UserLib written in full C++