Posted on Tuesday 26 July 2005
Flade is an actionscript toolkit designed to simplify the creation of physics engine and simulations. You can take a look at it here on SourceForge. I needed something fast and lightweight for physics simulation for a current top-secret project. First hurdle: it’s AS1. Argh! Thankfully I have my trusty FDT beta to help so it took about an hour to get it to compile and work in AS2 (package name is flade.*).
In its current state it’s remarkably usable and useful. Basically what you do is define particles, constraints and surfaces and you let the engine figure the rest out for itself. The engine has gravity by default built into it and a wheel primitive to give torque. To add a force to the system, since it uses verlet integration, you simply move a particle’s current point and do a timestep, and after that the engine will take care of respecting the constraints of the system. It’s quite fast, as I have it currently moving about 160 particles and 200 or so constraints and it’s still acceptably fast. Note however that this is split into about 20 independent engines, I’m guessing just one system with all that stuff would be slower.
I’m not releasing my hacked version as of yet as I need to add some stuff in it before I would consider it generically useful. One thing I dislike currently is that the rendering engine is mixed with the physics engine, presumably for performance reasons. It doesn’t seem like a very good idea to me as I’m still using my own rendering routines. I’ve added a new fixed point primitive for simulating a chain hooked to a ceiling for example, and I think it deserves a couple more general purpose primitives, and possibly other simple things like built-in forces, springs and such. I’ll let you know whenever I have something workable and documented.


