Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Pascal Chipmunk Physics port

  1. #1

    Pascal Chipmunk Physics port

    Hey everyone.

    I wanted to try using C OBJ files directly in Delphi, as described here:
    http://rvelthuis.de/articles/articles-cobjs.html

    I decided to use the Chipmunk Physics engine, as it's plain C (otherwise Box2D would've been it):
    http://wiki.slembcke.net/main/published/Chipmunk

    I got the files building with the free Borland C++ commandline tools, linked the objects in, converted the headers... but things went... a little weird thereafter. I kept getting random crashes.

    So I took a look, and with all the headers already converted, I figured I'd just go ahead and port the rest of the code.

    So that's what I've done, it's "working", it's got some glaring bugs (demo's 4 and 7), but it's alright to start working with already, I'd think.
    It _is_ just a direct port of the C code, and so isn't very Object Pascal-like, but as with the bugs, I'll be improving that situation over time if people are interested too.

    So, get it here:
    http://www.tisfat.pwp.blueyonder.co....mmy/index.html

  2. #2

    Pascal Chipmunk Physics port

    If it is Chipmunk that you are after and not the problem to use the C module in Delphi, then I'd like to point you to a thread at DanJetX forums, where a user named "Light" compiled the Chipmunk physics library into a small DLL and currently writes a Delphi wrapper to easily use it.

    He also posted a demo which shows some of the very nice Chipmunk features.

    I guess he will update this soon and finally posts source code (currently only demo exe and dll)

    You might also want to directly contact him at the forums.

    Here is the link:
    http://www.ericbehme.de/phpBB2DAN/viewtopic.php?t=506
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  3. #3

    Pascal Chipmunk Physics port

    Chipmunk is astounding. :shock: I certainly hope one, or both, of you succeed in making your headers for Chipmunk!

    Edit: WAIT, FPC can compile inline C can't it? I think it can... :think:

  4. #4

    Pascal Chipmunk Physics port

    Huehnerschaender: thanks, I didn't know anyone else was doing something Chipmunk related, handy to know!
    Chipmunk _was_ kind of just the victim of me having fun with C OBJ's in Delphi though

    Robert Kosek: I had no idea FPC could do that... *sigh*, I really should read before I go off on insane one night coding sessions... I'll go read up on it now.
    (P.S: not sure if I explained it properly, but I've actually converted all the code from C to Pascal, so there wouldn't be a need for the DLL at all, and effectively, I do have all the headers converted right now, sorry if I'm misunderstand you now)

    Meh, I stand by my first reason for doing this: fun. It might seem wrong, but I had fun converting it, it helped me learn a lot about the engine itself, and now using it is super easy.

    Regardless, thanks for the comments!

  5. #5

    Pascal Chipmunk Physics port

    I don't see what you've done as being wrong; native language ports are always welcome, especially if you keep them maintained. Under the MIT license I think that you are permitted to port the code, if you retain the original copyright. The MIT license is very liberal in what you can do with it.

    I thought you meant that you were compiling objects into the application like folks do with Zlib and BZip2. There is a Pascal port of Zlib, but not BZip2 unfortunately.

    I would be very interested in trying this out in the next 2d game I write. Must there be gravity, or could you run Chipmunk in space?

  6. #6

    Pascal Chipmunk Physics port

    Right, I have a tendancy of abusing the English language beyond comprehension, sorry.

    I _was_ trying to link in the OBJ files to prevent me from porting it, but then saw how little code there was, and ditched the OBJ idea.

    Chipmunk lets you set gravity, and when initialised, is 0, so basically space from the word go.

  7. #7

    Pascal Chipmunk Physics port

    Quote Originally Posted by NoshBar
    Right, I have a tendancy of abusing the English language beyond comprehension, sorry.
    Uh, I was actually skimming real quick and missed the fact that you said you ditched the OBJ data. My error, not yours. Your English is excellent.

    Thank you for your work in making a native port for Chipmunk. I will be trying this out sometime soon.

  8. #8

  9. #9

    Pascal Chipmunk Physics port

    Awesome! Thanks Brainer, I always trust other people's code over my own

    FreePascal doesn't seem to like some things in it, but that's easily fixed.
    It also includes chipmunk.inc, but I'm not sure if that's even necessary, it looks pretty complete without it...

    Anyway, I am truly grateful, ta!

  10. #10

    Pascal Chipmunk Physics port

    No probs, man! I'm glad it can be of any help to you.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •