Accessing island information

Zakalwe
Posts: 14
Joined: Mon Feb 04, 2008 5:23 pm

Accessing island information

Post by Zakalwe »

Hi all, I've got a few questions about how bullet uses islands.

1) I'm wondering if it's possible to find the number of islands currently active in bullet.
2) Is it possible to tell which island an object belongs to?
3) How is an Island bounded? an AABB?
4) I assume islands can merge and split. Can this be detected somehow?

All I know so far about Islands in bullet are that an object won't deactivate (even if it wants to and sets its state to wanting deactivation) if other objects are moving in its island. That's perfect for my purposes.

Any help would be appreciated. I'm working hard on a graphics paper and using physics for a rather novel purpose.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Accessing island information

Post by Erwin Coumans »

Zakalwe wrote: 1) I'm wondering if it's possible to find the number of islands currently active in bullet.
There is no API for island management/details or to get the number of islands, it is an internal detail. You will need to make some changes to the source code to expose this. See Bullet/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp (btSimulationIslandManager::buildAndProcessIslands) for details on implementation.
2) Is it possible to tell which island an object belongs to?
Yes, this is possible after the simulation step. Note that static objects are not part of islands, and use islandId -1.

Code: Select all

object->getIslandTag();
3) How is an Island bounded? an AABB?
Dynamic objects that have overlapping AABBs belong to the same island.
4) I assume islands can merge and split. Can this be detected somehow?
Each frame, island information is calculated from scratch, so there is no split. 'merge' is basically a union find operation.

Islands are mainly used for (de)activation of the simulation of objects, and as unit to solve constraints.
During our work on parallel optimizations for PS3 Cell SPUs, we discovered methods that can be parallelized better compared to those islands. Instead of using islands based on AABB overlap, we use a constraint splitting method similar to this Intel paper. See also those slides for an overview of the Bullet physic pipeline. This new constraint splitting implementation for Bullet hasn't been open sourced yet, no estimate when neither (depends on legal departments etc).

Hope this helps,
Erwin
Zakalwe
Posts: 14
Joined: Mon Feb 04, 2008 5:23 pm

Re: Accessing island information

Post by Zakalwe »

Hi Erwin, thanks very much for getting back to me on this. It's much appreciated. Steve says "Hi" back :)