Results 1 to 5 of 5

Thread: Clanlib physics

  1. #1
    Peasant pTymN's Avatar
    Join Date
    Oct 2006
    Location
    Durham, NC
    Posts
    9

    Default Clanlib physics

    Hi All,

    I mostly am posting just to say hello and provide some moral support. :-D Clanlib is awesome, and I'm glad that a forum was created, it seems like a good idea. In 2007, I will be releasing a 2D physics engine, that will easily integrate into Clanlib. About 2 years worth of work has gone into making it, and I couldn't think of anything cooler than advancing the Clanlib project with my contribution. Have a great day everybody.

    -Tim Kerchmar
    Screenshot of my project. Converted from Lisp to C++ and piled on even more optimizations. I can perform sorted collision testing between 20 objects at ~800 fps. Dynamic line-circle collision test source.

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    If the engine is written in LISP (that's what your signature hints), what are your plans for getting it integrated with ClanLib? The project will of course not mind distributing in a contrib directory or link your website, but I'm not sure if its a good idea to have a direct dependency on a LISP intepreter in ClanLib itself.

  3. #3
    Peasant pTymN's Avatar
    Join Date
    Oct 2006
    Location
    Durham, NC
    Posts
    9

    Default Lisp

    Hi Magnus,

    Last night I successfully performed some more optimizations and got 100fps on a decently complex scene. Progress. :-D

    I wrote the original version in Lisp, and the simplest route to contributing to Clanlib would be to convert all my many changes back to C++, so that there are no dependancies. I can produce a DLL that does not require an installation of the Lisp runtime, but my implementation is Win32 only. Am I correct in assuming that the most expedient route to integration is to do the conversion myself?

    Now a situation may have changed since Clanlib 0.8.x, but the provided collision detection was a little buggy the last that I checked. Here's what I would be offering:

    Collision outlines are a sequence of lines and circles that form completely enclosed shapes. Those shapes may be self-intersecting or concave if required. There is no tool nor plans for one that will help generate the outlines from a bitmap, that is up to a developer to create the tool or a xml based method of creating and modifying these outlines.

    The collision detection is full dynamic-dynamic, so fast moving objects collide perfectly with other objects. In a movement transaction all objects either don't move or are moved to positions that do not intepenetrate any other object. Contact points are recorded, as well as the normal of collision for that contact.

    Todo:

    Multiple physics layers.
    Animated outlines.
    Physical solver.
    Constraint/spring system.
    Arbitrary placement of objects.

    I think that without these features, it would not be useful enough in the general case for users of clanlib. As always, I want to at least provide a Clanlib integration of the physics engine so that Clanlib users can benefit from my work. :-D

    -Tim Kerchmar
    Screenshot of my project. Converted from Lisp to C++ and piled on even more optimizations. I can perform sorted collision testing between 20 objects at ~800 fps. Dynamic line-circle collision test source.

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Sorry about the late reply - I tend to not read the forum that often, hehe.

    The collision stuff in 0.8 is indeed fairly primitive and any better collision library stuff would be highly appreciated by ClanLib users, I'm sure. I just got the impression the stuff you did was done in Lisp (the final version to merge with clanlib) and if that would be the case it probably might present some problems as an external dependency.

    One of the goals of clanlib is to keep dependencies as a minimum, and when we must have them, ideally we can make it a seperate library with just that dependency. For example, the clanMikMod library exists only because the mod sound playing classes cannot be in clanSound without forcing everyone to include the mikmod library.

    If your collision stuff is written in Lisp, a similar dependency would arise and therefore could only be placed in ClanLib as a seperate module. That in itself is probably not that big a problem, but our build system stuff would probably have to be able to build your lisp code. Unless you design it so that it consists of two libraries, a clanCollision and a pTyhmnCollsion dll/lib/whatever that clanCollision then links to.

    We also have the option of not including it into clanlib itself, but simply making it available on our contrib page. With that model it doesn't have to follow any of the usual ClanLib rules or conventions.

    So basically I see there are three options:

    • Port the code to C++ and include it into ClanLib itself.
    • Make a clanCollision binding library that links with your lisp library (like PCRE and clanRegExp).
    • If the library generally do not follow the usual ClanLib API and/or coding rules, offer it under the contributions page on clanlib.org.


    Btw grats on the 100 fps stuff - it sounds like it works fast.

  5. #5
    Peasant pTymN's Avatar
    Join Date
    Oct 2006
    Location
    Durham, NC
    Posts
    9

    Default

    Its 100% C++ now. I've moved on from the collision stuff to the physical solver. Its pretty sweet, but kind of slow, because it converges slowly on the correct answer when objects are stacked. The collision only sample can now process 150 dynamic objects in close proximity at about 55fps on a 1.8GHz Athlon 64.
    Screenshot of my project. Converted from Lisp to C++ and piled on even more optimizations. I can perform sorted collision testing between 20 objects at ~800 fps. Dynamic line-circle collision test source.

Similar Threads

  1. Anyone using Microsoft Visual Studio Express with Clanlib?
    By killarkai in forum Official ClanLib SDK Forums
    Replies: 9
    Last Post: 12-24-2006, 03:16 PM
  2. Has the ClanLib home page closed???
    By Otto (Strange) Halmén in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 10-22-2006, 02:41 AM
  3. Submit Code to Clanlib
    By ART_Adventures in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 09-26-2006, 10:25 PM
  4. additional requirements for clanlib apps to run
    By killarkai in forum Official ClanLib SDK Forums
    Replies: 10
    Last Post: 09-19-2006, 06:22 AM

Bookmarks

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
  •