tags:

views:

220

answers:

2

I am trying to create a concave moving shape using bullet physics SDK but cannot find how to do it.

Do you have any idea on how to achieve this?

+2  A: 

I would suggest looking at "MovingConcaveDemo" which is in the Bullet SDK examples.

The project file is named "bullet-2.75\msvc\8appMovingConcaveDemo.vcproj" (where bullet-2.75 is the current version right now) if you're using Visual Studio 2008 but there are other projects as well for other IDEs.

Adisak
A: 

I just had this exact problem, bullet has shapes for doing this, but collisions did not work properly for me with those shapes, so I broke up my concave shape into lots of convex ones, did it using a btCompoundShape, with lots of btConvexHullShape as children. To break up a convex shape into triangles (which I just used as 3 point hulls), I used this class:

http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml

Hope this helps, contact me if you want the exact code (it is very tied in to my program though).