Only using collision system without game loop?

wooyay
Posts: 1
Joined: Fri Aug 07, 2009 8:04 am

Only using collision system without game loop?

Post by wooyay »

Hi all,
I have an application that does a lot of cylinder / mesh intersection tests as fast as possible (not a real time app). I currently use ODE, but ODE has accuracy problems with meshes with big triangles. I am now looking for a replacement. I first checked out NVidia PhysX, but with PhysX it is not possible to do collision tests outside the game loop. What I need is basically this:
void Collide(cylinder, mesh, vec3& intersectionpoints).
Is this possible in Bullet?
Thanks for your help!
Cheers,
Martin
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Only using collision system without game loop?

Post by Erwin Coumans »

You can use Bullet just for the collision detection.

Usually you don't want to call a single cylinder versus mesh, but add all objects to the btCollisionWorld, and call btCollisionWorld::performDiscreteCollisionDetection.

This performs all collision culling, and the contact points are stored in btPersistentManifold structures.
See Bullet/Demos/CollisionInterfaceDemo how to iterate over all btPersistentManifold structures to get the contact (intersection) points.

Hope this helps,
Erwin