2D Physics example: Line Of Sight with Chipmunk4PB

Advanced game related topics
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

void wrote:
IceSoft wrote:It will be delivered like the MP3D engine.
A binary release with some demos (also binaries) and with lot of example codes.
That's unfortunate. I was hoping to be able to use this, but I suppose I'll have to put together my own solution.
Sorry I do not understand you. The Chipmunk4PB wrapper is a static libray written in C++ which wrap the whole C function from the Chipmunk physics engine. You can use the wrapped function like an original Chipmunk C function together with PureBasic.

Maybe you have to see some examples first before you be unhappy with my solution.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by void »

IceSoft wrote:
void wrote:
IceSoft wrote:It will be delivered like the MP3D engine.
A binary release with some demos (also binaries) and with lot of example codes.
That's unfortunate. I was hoping to be able to use this, but I suppose I'll have to put together my own solution.
Sorry I do not understand you. The Chipmunk4PB wrapper is a static libray written in C++ which wrap the whole C function from the Chipmunk physics engine. You can use the wrapped function like an original Chipmunk C function together with PureBasic.
I'm trying to minimize the number of binary-only things I'm interacting with in my projects. At the moment, that list consists of only the PureBasic compiler. The Chipmunk physics engine itself is open source, so my long-term solution is almost certainly going to be to do my own PB bindings for Chipmunk.
IceSoft wrote:Maybe you have to see some examples first before you be unhappy with my solution.
Examples won't address my concerns, I'm afraid.
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

void wrote:The Chipmunk physics engine itself is open source, so my long-term solution is almost certainly going to be to do my own PB bindings for Chipmunk.
Yes that is a good idea. One more binding is an improvement for all (Chipmunk and PureBasic).
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by void »

IceSoft wrote:
void wrote:The Chipmunk physics engine itself is open source, so my long-term solution is almost certainly going to be to do my own PB bindings for Chipmunk.
Yes that is a good idea. One more binding is an improvement for all (Chipmunk and PureBasic).
I'm pretty close to ready to publish my preliminary results with chipmunk 6.x so far. Not just the wrapper itself, but the methodology; it's been a heck of a learning experience.

I haven't tested it for sure yet on platforms aside from x86 windows, but I believe this will be usable on both windows and macOS, 32-bit and 64-bit. It's a mixture of PureBasic and plain C, with a heck of a lot of auto-generated stuff.

And oh, so many mistakes I've made along the way...

But as of this moment in time, I'm successfully getting the simulation going, able to add entities and collision callbacks.. It's hard to measure performance, since my test framework seems to be hitting on graphics performance quirks in PureBasic. (and anyway, the Chipmunk library itself is still compiled debug for now)
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

void wrote:I'm pretty close to ready to publish my preliminary results with chipmunk 6.x so far. Not just the wrapper itself, but the methodology; it's been a heck of a learning experience.
Thanks. I am very interest about your result.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by void »

If you want to see my posts on my struggles so far, you can find them here (part 1) and here (part 2).

Warning, strong opinions therein. :)

I want to get things to a more polished/validated state before posting anything for people to use, although I do have one of my test applications on dropbox here.

This is an x86 windows binary that does nothing special except put 8000 objects on the screen, and do some 'world wrapping' at screen edges. The circles do collide with each other, though it's hard to tell.
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

void wrote:This is an x86 windows binary that does nothing special except put 8000 objects on the screen, and do some 'world wrapping' at screen edges. The circles do collide with each other, though it's hard to tell.
Hello void,
Can I get the PureBassic Source code for comparing the performance between your gcc and my VisualStudio compiler settings?
A PM is also welcome.

Thanks
Icesoft
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by void »

IceSoft wrote:Can I get the PureBassic Source code for comparing the performance between your gcc and my VisualStudio compiler settings?
A PM is also welcome.
I suppose so. My current testbed code is pretty hideous, though. I'll send both the .pb and the .pbi code in a PM.
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

@void,

I have adapt it and it works different.
My chipmunk wrapper creates a border. Your wrapper does it not.
Hope I can send the sources today afternoon.
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
Pforzheimer
User
User
Posts: 21
Joined: Thu Sep 25, 2008 7:12 am
Location: Germany
Contact:

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by Pforzheimer »

Hello IceSoft,
your website is gone:
chipmunk4purebasic.freeforums.org was removed for inactivity on Dec 16, 2012.
Got another one? Or will you rebuild it?

Greetings
Still awaiting real brain interface for computers :-)
[ REGISTERED PB OWNER since years ] [Wind0ws + LINUX]
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 2D Physics example: Line Of Sight with Chipmunk4PB

Post by IceSoft »

Pforzheimer wrote:Hello IceSoft,
your website is gone:
chipmunk4purebasic.freeforums.org was removed for inactivity on Dec 16, 2012.
Got another one? Or will you rebuild it?

Greetings
Try www.dreifrankensoft.de (this will be a new start with my own domain)
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Post Reply