What are Islands?

Feb 21, 2010 at 8:33 AM

A question came up on the Creator's Club forums regarding the purpose of the Island class. I'm copying/pasting my reply here in case anyone else has the same question:

The Island class is primarily used internally, and consists of a group of "touching" objects. By "touching" I mean they share some common constraint--whether it's a basic contact constraint or another type that is created by the game. This is a pretty common technique in many physics engines for deactivating groups of objects that are no longer active (e.g., I do this pretty much the same way JigLibX does). If an entire group of objects are eligible for deactivation, then they no longer need to be considered in collisions with each other, nor do their constraints need to be solved. They can simply be frozen until re-activated by a certain event like a collision with an active object.

In Henge3D, islands serve another purpose as well: they allow for independent tasks to be run in a concurrent manner via threading. Say, for example, I have 3 big stacks of blocks that aren't colliding with each other at all. They can be considered three separate systems in terms of solving their constraints. Therefore, it becomes practical to solve each island in a separate thread. An island, then, is really just a way of organizing those tasks. I believe the Bullet engine has a very similar feature.