interaction between ghostObject and btSoftBody

Dena
Posts: 4
Joined: Thu Nov 20, 2008 5:17 pm

interaction between ghostObject and btSoftBody

Post by Dena »

In my application I want a ghostObject to interact with a softbody. I want to compute the collision between a ghostObject and a btSoftBody.
I have tried to read collision information by applying the same strategy that I'm using far collision between rigid bodies, i.e. by calling the m_broadphase->getOverlappingPairCache()->findPair(pair.m_pProxy0,pair.m_pProxy1) method.
However, it seens that the size of the manifoldArray is zero.

Code: Select all

	btManifoldArray	manifoldArray;
	btBroadphasePairArray& pairArray = m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray();
	
	int numPairs = pairArray.size();
		
	for (int i=0;i<numPairs;i++)
	{
		manifoldArray.clear();
			
		const btBroadphasePair& pair = pairArray[i];

		btBroadphasePair* collisionPair = m_broadphase->getOverlappingPairCache()->findPair(pair.m_pProxy0,pair.m_pProxy1);

		if (!collisionPair)
			continue;

		if (collisionPair->m_algorithm)
			collisionPair->m_algorithm->getAllContactManifolds(manifoldArray);

		for (int j=0;j<manifoldArray.size();j++){
                               ........
If I collect collision information by invoking

Code: Select all

btBroadphasePair* collisionPair = m_broadphase->getOverlappingPairCache()->getOverlappingPairArrayPtr();
the manifoldArray is not empty, however it contains a lot of pairs even for rigid bodies. And I'm not able to handle them correctly.
In summary I don't understand the difference between findPair() and getOverlappingPairArrayPtr().