Basic concave collision detection question [HELP]

Post Reply
nictosi
Posts: 11
Joined: Mon Jul 06, 2015 9:25 am

Basic concave collision detection question [HELP]

Post by nictosi »

Hi,
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 (http://andrestraks.github.io/BulletSharp/) a maintained C# wrapper of Bullet. what I did, was set up my bullet environment:

Code: Select all

            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);    
and load my CollisionObjects as BvhTriangleMeshShape.

To detect collisions, I used:
1.

Code: Select all

 contactTest(object, callback) 
. Here the problem is that the ContactResultCallback::NeedsCollision function is called every time two bounding boxes intercept, but no manifolds are found if 2 meshes intersect.
2.

Code: Select all

   bt_collision_world.PerformDiscreteCollisionDetection();
                int numManifolds = bt_collision_world .Dispatcher.NumManifolds; 

Here the problem is that no manifolds are found at all.
Post Reply