btPersistentManifold & number of contact points

ramsampath
Posts: 19
Joined: Fri Sep 05, 2008 8:54 pm

btPersistentManifold & number of contact points

Post by ramsampath »

Hello,

i had a quick question regarding the number of manifolds as reported by btPersistentManifold* from (world->getDispatcher()->getInternalManifoldPointer())

in a tickcallback the number of manifolds reported by that pointer in my case seems to be far greater than the number of contacts in a case with convex convex collisions.

my question is just that in what cases would there be a large number of bodies reported by btPersistantManifold* and a relatively few number or mostly 0 number of contact points within each of that manifold.

in relation to that
is my assumption that the getNumManifolds() method in btPersistantManifold returns the number of bodies colliding in the broadphase and the contacts reports in the narrow phase is correct ?


for example: here's a code snippet in a tickcallback

Code: Select all

   btDispatcher *d = world->getDispatcher( );
    btPersistentManifold** manifoldptr = d->getInternalManifoldPointer ();
    int numManifolds                   = d->getNumManifolds ();
    std::cout << "Number of bodies colliding " << numManifolds << std::endl;    
    int nnumContacts = 0;
    for( unsigned i = 0; i < numManifolds; i++ ) {
        btPersistentManifold* manifold    = manifoldptr [i];
        int numContacts                   = manifold->getNumContacts ();
        nnumContacts += numContacts;
    }
    std::cout << "  Total Num contacts " << nnumContacts << std::endl;
In a lot of cases the second print reports 0 and the first print reports a big number like 1000.


thank you very much in advance for your time.

ram.
ramsampath
Posts: 19
Joined: Fri Sep 05, 2008 8:54 pm

Re: btPersistentManifold & number of contact points

Post by ramsampath »

I guess I can answer my question based on what I found.

btPersistantManifold's getNumManifolds() seems to indeed point to the number of Broadphase collisions which seemed to have happened and the manifold's getNumContacts() seems to report the number of actual contacts in the Narrowphase collision check.

Please correct me if I am wrong.

Ram.