Collision only - Swept queries?

angrybaker
Posts: 10
Joined: Mon Nov 17, 2008 10:40 pm

Collision only - Swept queries?

Post by angrybaker »

Hi I was wondering what the state of swept queries are in Bullet.

I'm hoping to integrate Bullet in my simple game engine, in which when entities move, their collision bounds are swept in their velocity direction, and appropriate action is taken if it collides with anything.

Is bullet suitable for this? Some of the previous posts I've read on this forum seem to indicate that it's kind of slow and unoptimized (Checking every collision object in the world rather than having some kind of spacial partitioning) - is that still the case?

A lot of my entities would be made up of simple primitives like cubes/spheres etc, but I would also like to have the option of having a simplified mesh to collide against.. is that kind of thing supported for sweeps?

Or is using Bullet kind of overkill for that I want to do?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Collision only - Swept queries?

Post by Erwin Coumans »

angrybaker wrote: Is bullet suitable for this? Some of the previous posts I've read on this forum seem to indicate that it's kind of slow and unoptimized (Checking every collision object in the world rather than having some kind of spacial partitioning) - is that still the case?

A lot of my entities would be made up of simple primitives like cubes/spheres etc, but I would also like to have the option of having a simplified mesh to collide against.. is that kind of thing supported for sweeps?
Yes, Bullet is suitable for that.

Swept collision queries are supported for primitive collision shapes (box, sphere, cylinder etc), simplified convex hull meshes (btConvexHullShape) and also for static concave triangles meshes (btbvhTriangleMeshShape includes acceleration for ray and convex queries). Check out Bullet/Demos/ConcaveConvexcastDemo.

Both ray cast and convex cast are using the broadphase acceleration structure now:
http://code.google.com/p/bullet/issues/detail?id=144

We appreciate your feedback,
Erwin

By the way: in case you don't use Bullet Dynamics, you can safely remove the source code (Bullet/src/BulletDynamics, Bullet/src/BulletSoftBody). The collision detection has no dependencies on those parts.
angrybaker
Posts: 10
Joined: Mon Nov 17, 2008 10:40 pm

Re: Collision only - Swept queries?

Post by angrybaker »

Thanks - exactly what I needed to know. I did some work today and got it basically working. Thanks again!