Page 1 of 1

Use only narrow phase collision detection

Posted: Mon Dec 15, 2008 7:03 pm
by peterk
Hi,

I'm interested in using the narrow phase part of Bullet's collision detection separately, but am unsure how this is done.

Ideally, I'd like to create two sets of btCollisionShape (of whatever type) plus corresponding btCollisionObject and collide them, returning the list of contacts.

Can this be done?

Thanks.

Re: Use only narrow phase collision detection

Posted: Fri Jan 02, 2009 11:51 pm
by slithEToves
Yes, this can be done.

Setup a btDefaultCollisionConfiguration, btCollisionDispatcher, and btDispatcherInfo. If you want easy object management, you can use a btCollisionWorld, but if you manage your own objects and pairings like it sounds like you are doing (using only Bullet's narrow phase), this isn't necessary.

With each pair, just call findAlgorithm on the dispatcher, then call processCollision on the algorithm. processCollision will need a properly setup btManifoldResult structure. Make sure to call freeCollisionAlgorithm afterward.

You get the collision data from the btManifoldResult.

Re: Use only narrow phase collision detection

Posted: Mon Jan 05, 2009 6:55 pm
by peterk
Thanks, I've got this working now.