Triangle mesh and particles

rockyspirit
Posts: 1
Joined: Tue May 15, 2012 12:32 pm

Triangle mesh and particles

Post by rockyspirit »

I have an application with dynamic bodies with triangle meshes using btGImpactMeshShape. Everything inside bullet works fine.
However, I also have a particle system which I need to collide with the bullet world. That is done in the following way:

Code: Select all

btSphereShape particleShape(radius);
btCollisionObject particle;
//Initialize particle shape and transform

btCollisionAlgorithm * algorithm = dispatcher->findAlgorithm(bulletBody, &particle);
btManifoldResult result(bulletBody, &particle);
algorithm->processCollision(bulletBody, &particle, dispatchInfo, &result);

//Check manifolds and process accordingly
The above code was created checking the various demos and bullet source code and it works fine with almost any kind of shape.

However, if I register btGImpactCollisionAlgorithm, the mesh-particle collision does not work as expected: It collides but with huge errors, which is unacceptable for my application. If it is not registered, everything works fine with low error... except the meshes won't collide between each other, as expected.

Finally: I need good mesh-particle collision but I also need mesh-mesh collision and I have no idea how to do so.