Use only narrow phase collision detection

Post Reply
peterk
Posts: 14
Joined: Mon Dec 15, 2008 6:52 pm

Use only narrow phase collision detection

Post 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.
slithEToves
Posts: 24
Joined: Mon Mar 12, 2007 9:55 pm

Re: Use only narrow phase collision detection

Post 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.
peterk
Posts: 14
Joined: Mon Dec 15, 2008 6:52 pm

Re: Use only narrow phase collision detection

Post by peterk »

Thanks, I've got this working now.
Post Reply