Posts Tagged ‘island solver’


islands + rigid body sleep + time of impact

October 30, 2008

So, on the topic of time of impact.  The first thing I realized, is that time of impact calculations if done with the proper time conservation (advance all by nearest time of impact, solve, and repeat until timestep is gone) are enormously costly for massive groups of bodies.  This is because you update EVERY BODY in the system all those times whether you need to or not.  A good fix, which is also practical for putting bodies to sleep, is solver islands.  Basically, isolate groups of topologically adjacent bodies through contacts and constraints.  Then simulate them independently, including doing less TOI substeps for islands that don’t need that many.  It’s actually not even possible to do the unneccessary steps on an island solver architecture.  The reason this is also good for the sleeping scheme, is that putting islands to sleep as a whole instead of each body individually is much more stable, because you know that once all have settled, there is nothing still moving to keep the others awake.  And again, doing this per island allows you to be more efficient, because per body takes longer and is less stable, and per world is useless because there is always something moving in a video game.

Well, one of my dad’s friends reviewed my presentation (he’s an electrical engineer with programming experience in microcontrollers) and he said it was so good it could get me in to MIT.  I have a good feeling about this.  😀


time of impact islands + talk presentation thingy

October 23, 2008

HEY HEY HEY HEY HEY HEY HEY HEY *gets smacked down*


You’re not guessing.  I’ll tell you!  I’m actually giving a talk at Columbia College about my physics project.  Here’s essentially what I got off Dr. Liow.  Dr. Liow is probably one of the best people to recognize anything you do, because he seems like he’d be honest if he didn’t like what you’ve done.  In an email he was all: “Your program is interesting.  Do you want to give a talk about it during lunch, blabitty bloo, blabitty bloo, blabitty bloo, it’s totally unofficial, blabitty bloo, it’s in a room with some people, blabitty bloo, blabitty bloo, this is totally gonna be like a presentation during lunch so omg r u interested?”  Man, I hope he doesn’t read that.  Meh, I don’t really care.  Anyway, I was all “shit yeah” and he’s all “omg I haven’t even checked my email yet so I haven’t responded yet.”  So I’m still waiting for a reply.  But I’m psyched, and I really like the idea of publicising my physics engine, if even on a local scale, so I’m definitely going to be there.  I’m gonna make slides, demos, tacos, nachos, and paper mache!  Okay, actually just slides and demos.  Can you tell I’m giddy?  Huh?  Is it showing?  ANSWER ME!  YAAAAAAAYYYYY!!!!!!!!

This is pretty awesome.  All I’m sayin’.

NOW.  On the topic of actual work that I’m doing on physics.  You may have thought about time of impact and how it would slow everything down.  You’re damn right it will.  The question is, how can we optimize it as much as possible?  In the most accurate TOI model, you find the pending collision with the smallest TOI, advance by that amount, (of course setting a minimum fraction of total timestep so we don’t get stuck at toi==0.0 forever,) handle collisions normally, run the impulse solver, and repeat until the timestep is done.  But what about Joe McStranded off in the distance who won’t collide with anyone for at least a dozen frames?  Should we waste time sub stepping him?  NO.

The solution: islands.  This is a technique I am shamelessly stealing from Bullet Physics.  But we all stand on the shoulders of giants, right?  Anyway, an island is essentially a field of objects which will all interact with one another in the next frame.  An island of objects are all linked by constraints, contacts, and bounding box sweeps.  Anything which may collide with other bodies in the island or be affected by a body in the island is in, basically. This means the loners are all omitted from the expensive sub steps in time of impact solving, and this also means smaller islands who will do less sub steps than the bigger ones.

So, as for sweep algorithms, I have circles down, and I’m trying to do the MSA-sweep now.  I’m not exactly sure of how it will turn out on rotating bodies, as I’ve said before.  I may wind up using the conservative advancement method.  I’ve said this before, I’m just rehashing it.

Think about using islands in your own work.