Friday, 3 December 2010

Building my own Delphi Physics Engine part I

 These days I've been working on my own Delphi Physics Engine based on the very well known APE (ActionScript Physics Engine) with some improvements that will help developers to build models very fast. In this beta version I've done the following improvements:
  • Enhance user performance.
  • Drastic reduction of Memory leaks.
  • Improve the interoperability between objects.
  • Improve maths algorithms to collision detection.
  • Use the VLO GDI Render to perform the drawing of the shapes.
In this first insight into the Engine, I'm going to show you a model of the Jansen mechanism, a kinetic sculpture that can move with the help of several pairs of legs.

I've built my own model taking advantage of the physic engine and imagination!.
Here you can see my own model:
The movement is still not very well performed, but it's due to the measures of the different parts of the sculpture. As for the calculation points, I've used the next template:
You can download the demo project from here (Thundax Test Forces). To play with the application, you only need to press 'z' to start the kinetic sculpture, and as for the objects below the sculpture, press 'd' and you'll force a collision between two objects.

The next days I'll be improving the model (you can see the kinetic analysis that is plotted below the sculpture) and adding the extra foot to perform a fully movement.

Enjoy the learning!.

Related links:


  1. Hi Jordi,

    Nice work, seems to be cool. And fast.
    Performance was problem that I encountered in my work on APE.

    Please to read you about physics stuff !


  2. Hi Vincent,

    Thank you very much for your comment. I'll take a closer look at your project to see if I could use something. I think that you did a really good and interesting job with the Delphi conversion.
    I'm really glad that you like it. I'm still working on the deployment process and the library would be ready in a few months here:
    Thundax Delphi Physics Engine


  3. Hi Jordi,

    As I See, the 2 only common things about our work is
    - It is in Pascal.
    - We have basicaly translate the APE from AS to Pascal.
    But that's all, I thing ! As I See you push the stuff more far as I (can) do. And that's amazing - The perf looks excelent !!
    You'd see certainly my compare work on Box2, but I stop work on it due of work overhead. :(
    But your work give me hope and feel to look it again. At less to attempt to wed your library with oo graphics stuff perhaps ?

    Read you soon ! :)



  4. Hi Vincent,

    Thanks for your comment. Sometimes is difficult to go on with projects like this when you don't have enough time, but when I feel inspired my mind turns red and I can't put it down. For now, I'm trying to develop everything from scratch, taking into account the final throughput, the GDIRender and the threading process. I also recommend you to take a look at my previous work with Force-Directed graph layout approximation part I totally developed under my VLOFramework..

    I'm still refactoring all the UML diagrams of the project as I'm trying to add more features like the cutting tool and the numeric display of the resultant forces as an object is selected.

    Thanks for reading!.


  5. Hi! About the movement imprecision, mainly in right leg, it seems to me that K and J edges have different lengths in left and right sides (lags). Best.

    1. Hi HydroByte,

      You might be right. I'll check the definition of that leg as there might be something off. Many thanks for pointing this out.