I am a Bullet rookie, so I apologise in advance if my questions sound trivial to you.
I need to load a set of concave triangle meshes from .stl files and perform collision detection. Objects can be moved by the user. From the user manual, I read: "CONCAVE TRIANGLE MESHES: For static world environment, a very efficient way to represent static triangle meshes is to use a btBvhTriangleMeshShape."
Hence, my questions are: - can Bullet detect collisions between concave mesh objects modelled using the BvhTriangleMeshShape? - what is the real difference between contactTest and CollisionWorld::PerformDiscreteCollisionDetection() - do I need to specify a different collision algorithm for concave collision detection?
I am working with BulletSharp a maintained C# wrapper of Bullet. what I did, was set up my bullet environment:
CollisionConfiguration bt_collision_configuration;
CollisionDispatcher bt_dispatcher;
BroadphaseInterface bt_broadphase;
CollisionWorld bt_collision_world;
double scene_size = 500;
uint max_objects = 16000;
bt_collision_configuration = new DefaultCollisionConfiguration();
bt_dispatcher = new CollisionDispatcher(bt_collision_configuration);
float sscene_size = (float)scene_size;
Vector3 worldAabbMin = new Vector3(-sscene_size, -sscene_size, -sscene_size);
Vector3 worldAabbMax = new Vector3(sscene_size, sscene_size, sscene_size);
bt_broadphase = new AxisSweep3_32Bit(worldAabbMin, worldAabbMax, max_objects);
bt_collision_world = new CollisionWorld(bt_dispatcher, bt_broadphase, bt_collision_configuration); [/code]
And load my CollisionObjects as BvhTriangleMeshShape
.
To detect collisions, I used:
contactTest(object, callback)
The result with this code is that the ContactResultCallback::NeedsCollision
function is called every time two bounding boxes intercept, but no manifolds are found if 2 meshes intersect.
And secondly:
bt_collision_world.PerformDiscreteCollisionDetection();
int numManifolds = bt_collision_world.Dispatcher.NumManifolds;
Using this secondary code, no manifolds are found at all.