Triangle Mesh Optimizations

SirShane
Posts: 2
Joined: Fri Dec 30, 2005 7:32 am
Location: Colorado Springs, CO

Triangle Mesh Optimizations

Post by SirShane »

We're currently integrating Bullet into our engine to evaluate it's use. The version that I've downloaded (From the Bullet CVS download link on the main page) does not seem to contain any major spacial optimizations in the triangle mesh collision code (Like kd-tree, etc). Is this a feature that is going to be implemented in the near future? If it's not, I can go ahead and implement it myself. I just want to know if this has already been added, but not placed in CVS or anything. (I just don't want to go through the trouble if it's already been done...)

If this hasn't already been done, I can do it myself and share the code if you want.

Thanks for the great library!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

A bounding volume hierarchy has been added to cvs today and the bullet source archive has been updated. Please let me know if this works for you. The vc7/vc8 projectfiles have been updated, if you use vc6 please add a few files from the Bullet/CollisionShapes folder:

BvhTriangleMeshShape.cpp
OptimizedBvh.cpp
TriangleIndexVertexArray.cpp
TriangleCallback.cpp

The ConcaveDemo demonstrates the BvhTriangleMeshShape use.

Unfortunately there are some problems related to incorrect penetration depth that causes jitter and jumping in the demo. I will look into that the coming days, but for now, you can revert to Solid EPA penetration depth by uncommenting this line in ConvexConvexAlgorithm.cpp:
//#define USE_EPA
And add the Extras/Solid35/ library.

Thanks,
Erwin
SirShane
Posts: 2
Joined: Fri Dec 30, 2005 7:32 am
Location: Colorado Springs, CO

Post by SirShane »

Thanks for the quick reply!

I've updated CVS and got it compiled okay. I'll be able to integrate and test the new bounding volume stuff in my own engine over the next few days. The demo looks great so far, although I did notice some jittering like you mentioned.

While i'm posting here, I also noticed that the setRigidBody method on the PhysicsController class is not implemented. This is another feature we'll need soon for player-controllable entities. Should I go ahead and implement this myself, or will this too be added in short order? I noticed that this feature was actually available in the old Blender physics code, but now it's missing.

The way I planned on implementing it myself was to just disable any changes to the RigidBody class's torque and angular velocity variables. The problem is that I don't know if that will have any adverse effects on the simulation (I can't see why it would... but who knows!)

Bullet is an awesome library. I look forward to evaluating it more! Thanks again.