The eagle-eyed among you may have noticed:
(i.e. revision 31128)
This commit basically adds support for using Blender's "Force Fields" in Rigid Body simulations. They are a way of allowing you to "sculpt" the simulation result. Here's a little illustration of effectors in action:
|Before (running simulation)|
|After (while simulation is running)|
In the meantime, go out and have fun with these new toys :)
For those curious about how this works, here's a little overview:
Blender already has a unified system for handling effectors. Basically, it takes all the effectors you're worrying about, and determines the "net force" (i.e. consider it grabbing a bunch of arrows pointing in different directions, mushing that together, and getting a single big arrow pointing in the direction that the combination of arrows were pointing before) for each "particle"-like entity it is asked to determine this net force for. This is then simply fed into Bullet as an external force that gets applied to the Rigid Bodies for whatever reason (the same thing happens with the other sims too AFAIK).
For anyone who's looking at implementing such support for another physics sim in future, have a look at rigidbody_update_sim_ob() in blenkernel/rigidbody.c, particularly the first block only (/* update influence of effectors - but don't do it on an effector */) as in the linked commit. I can't guarantee it'll still be there in later revisions, though it most likely will stay put :)
Also, while testing that earlier file again with a different build, I've been able to get things working quite nicely for a demo. So, without further ado, here's that file (shown in the screenshots above):
And as promised earlier, a video demo of this in action :)
Remember, you'll need one of the latest builds of my SoC branch to get that to work.