PureBasic Forum
https://www.purebasic.fr/english/

Interface to Chipmunk 7.0.1 [2D physics engine]
https://www.purebasic.fr/english/viewtopic.php?f=16&t=64161
Page 2 of 2

Author:  Lunasole [ Sat Jan 02, 2016 7:57 am ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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)

Author:  Lunasole [ Mon Mar 21, 2016 11:55 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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.

Author:  Octavius [ Sun Mar 27, 2016 10:33 am ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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.

Author:  Lunasole [ Sun Mar 27, 2016 12:38 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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.

Author:  Octavius [ Mon Mar 28, 2016 2:26 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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.

Author:  Lunasole [ Tue Mar 29, 2016 3:51 am ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

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

Author:  Lunasole [ Tue Mar 29, 2016 4:45 am ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Btw, I just updated binaries with this small change
Code:
- 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.

Author:  Lunasole [ Wed Jun 15, 2016 10:51 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

Update because of this
Code:
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 ^^

Author:  ShaunRW [ Sun Sep 18, 2016 9:08 am ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

I am a noob to PureBasic. How would I go about using the Chipmunk physics engine on Mac OSX?

Author:  IceSoft [ Mon Sep 19, 2016 12:27 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

This is windows only compilied

Author:  IceSoft [ Wed Apr 12, 2017 8:03 pm ]
Post subject:  Re: Interface to Chipmunk 7.0.1 [2D physics engine]

You can also use the Chipmunk4PB_7.01 :
viewtopic.php?f=14&t=44068

Biggest news:
As UserLib written in full C++

Page 2 of 2 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/